bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] [patch] fix busy loop when inetd does not listen for any


From: Guillem Jover
Subject: [bug-inetutils] [patch] fix busy loop when inetd does not listen for any service
Date: Thu, 20 Apr 2006 04:41:42 +0300
User-agent: Mutt/1.5.11+cvs20060126

[ I'm resending those patches, as I was not previously subed and the
  other mails were held in hostage for moderation. ]

Hi,

This patch fixes a busy loop when inetd does not have any service, due
the use of the non-portable sigpause. It has been applied in the
debian package for some time now.


2006-01-10  Guillem Jover  <address@hidden>

        * inetd/inet.c (main): Use sigsuspend on POSIX systems, otherwise
        sigpause with sysv semantics waits for no signal.


diff -aur inetutils-1.4.3+20060110/inetd/inetd.c 
inetutils-1.4.3+20060110.new/inetd/inetd.c
--- inetutils-1.4.3+20060110/inetd/inetd.c      2005-10-30 01:26:50.000000000 
+0300
+++ inetutils-1.4.3+20060110.new/inetd/inetd.c  2006-01-10 23:53:15.000000000 
+0200
@@ -484,10 +484,18 @@
 
       if (nsock == 0)
        {
+#if defined(HAVE_SIGACTION)
+         sigset_t empty;
+       
+         sigemptyset (&empty);
+         while (nsock == 0)
+           sigsuspend (&empty);
+#else
          signal_block (NULL);
          while (nsock == 0)
            sigpause (0L);
          signal_unblock (NULL);
+#endif
        }
       readable = allsock;
       if ((n = select (maxsock + 1, &readable, NULL, NULL, NULL)) <= 0)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]