*** empty log message ***
[bpt/emacs.git] / src / process.c
index 10bfa76..4f6d283 100644 (file)
@@ -1268,7 +1268,7 @@ Returns nil if format of ADDRESS is invalid.  */)
   if (VECTORP (address))  /* AF_INET or AF_INET6 */
     {
       register struct Lisp_Vector *p = XVECTOR (address);
-      Lisp_Object args[6];
+      Lisp_Object args[10];
       int nargs, i;
 
       if (p->size == 4 || (p->size == 5 && !NILP (omit_port)))
@@ -1305,7 +1305,6 @@ Returns nil if format of ADDRESS is invalid.  */)
       args[0] = build_string ("<Family %d>");
       args[1] = Fcar (address);
       return Fformat (2, args);
-
     }
 
   return Qnil;
@@ -6501,17 +6500,17 @@ sigchld_handler (signo)
 #define WUNTRACED 0
 #endif /* no WUNTRACED */
       /* Keep trying to get a status until we get a definitive result.  */
-      while (1)
-       {
+      do
+        {
+         /* For some reason, this sleep() prevents Emacs from sending
+             loadavg to 5-8(!) for ~10 seconds.
+             See http://thread.gmane.org/gmane.emacs.devel/67722 or
+             http://www.google.com/search?q=busyloop+in+sigchld_handler */
+          usleep (1000);
          errno = 0;
          pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
-         if (! (pid < 0 && errno == EINTR))
-           break;
-         /* Avoid a busyloop: wait3 is a system call, so we do not want
-            to prevent the kernel from actually sending SIGCHLD to emacs
-            by asking for it all the time.  */
-         sleep (1);
        }
+      while (pid < 0 && errno == EINTR);
 
       if (pid <= 0)
        {