sysvinit: avoid wakeups
authorGrazvydas Ignotas <notasas@gmail.com>
Thu, 12 May 2016 00:02:40 +0000 (03:02 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Thu, 12 May 2016 00:02:40 +0000 (03:02 +0300)
doesn't seem to be necessary from looking at the code

recipes/sysvinit/sysvinit-2.86/no_wakeup.patch [new file with mode: 0644]
recipes/sysvinit/sysvinit_2.86.bb

diff --git a/recipes/sysvinit/sysvinit-2.86/no_wakeup.patch b/recipes/sysvinit/sysvinit-2.86/no_wakeup.patch
new file mode 100644 (file)
index 0000000..2ae885b
--- /dev/null
@@ -0,0 +1,53 @@
+diff -ur sysvinit-2.86_/src/init.c sysvinit-2.86/src/init.c
+--- sysvinit-2.86_/src/init.c  2004-07-30 15:16:20.000000000 +0300
++++ sysvinit-2.86/src/init.c   2016-05-12 02:37:44.943803255 +0300
+@@ -1998,7 +1998,7 @@
+  *            the 2.2 kernel credential stuff to see who we're talking to.
+  *    
+  */
+-void check_init_fifo(void)
++void check_init_fifo(int timeout_sec)
+ {
+   struct init_request request;
+   struct timeval      tv;
+@@ -2055,13 +2055,15 @@
+   /* Wait for data to appear, _if_ the pipe was opened. */
+   if (pipe_fd >= 0) while(!quit) {
+-
++      struct timeval *timeout = NULL;
+       /* Do select, return on EINTR. */
+       FD_ZERO(&fds);
+       FD_SET(pipe_fd, &fds);
+-      tv.tv_sec = 5;
++      tv.tv_sec = timeout_sec;
+       tv.tv_usec = 0;
+-      n = select(pipe_fd + 1, &fds, NULL, NULL, &tv);
++      if (timeout_sec >= 0)
++              timeout = &tv;
++      n = select(pipe_fd + 1, &fds, NULL, NULL, timeout);
+       if (n <= 0) {
+               if (n == 0 || errno == EINTR) return;
+               continue;
+@@ -2218,7 +2220,7 @@
+                       warn = 0;
+                       loglevel = -1;
+                       if (got_signals == 0)
+-                              check_init_fifo();
++                              check_init_fifo(5);
+                       break;
+       }
+       if (loglevel > 0) {
+@@ -2472,10 +2474,10 @@
+               for(ch = family; ch; ch = ch->next)
+                       if (ch->flags & WAITING) break;
+       }
+-      if (ch != NULL) check_init_fifo();
++      if (ch != NULL) check_init_fifo(5);
+      }
+ #else /* CHANGE_WAIT */
+-     if (ch != NULL && got_signals == 0) check_init_fifo();
++     if (ch != NULL && got_signals == 0) check_init_fifo(-1);
+ #endif /* CHANGE_WAIT */
+      /* Check the 'failing' flags */
index 33e588c..5df2dad 100644 (file)
@@ -2,7 +2,7 @@ DESCRIPTION = "System-V like init."
 SECTION = "base"
 LICENSE = "GPLv2+"
 HOMEPAGE = "http://freshmeat.net/projects/sysvinit/"
-PR = "r60"
+PR = "r61"
 
 # USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf.
 # Set PACKAGE_ARCH appropriately.
@@ -20,6 +20,7 @@ SYSVINIT_ENABLED_GETTYS ?= "1"
 
 SRC_URI = "ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-${PV}.tar.gz \
            file://install.patch;patch=1 \
+           file://no_wakeup.patch;patch=1 \
            file://need \
            file://provide \
            file://inittab \