emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/process.c,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/process.c,v
Date: Thu, 29 May 2008 16:54:54 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/05/29 16:54:54

Index: process.c
===================================================================
RCS file: /sources/emacs/emacs/src/process.c,v
retrieving revision 1.542
retrieving revision 1.543
diff -u -b -r1.542 -r1.543
--- process.c   22 May 2008 14:53:26 -0000      1.542
+++ process.c   29 May 2008 16:54:53 -0000      1.543
@@ -3896,6 +3896,7 @@
 seconds and milliseconds to wait; return after that much time whether
 or not there is input.  If SECONDS is a floating point number,
 it specifies a fractional number of seconds to wait.
+The MILLISEC argument is obsolete and should be avoided.
 
 If optional fourth arg JUST-THIS-ONE is non-nil, only accept output
 from PROCESS, suspending reading output from other processes.
@@ -3911,6 +3912,18 @@
   else
     just_this_one = Qnil;
 
+  if (!NILP (millisec))
+    { /* Obsolete calling convention using integers rather than floats.  */
+      CHECK_NUMBER (millisec);
+      if (NILP (seconds))
+       seconds = make_float (XINT (millisec) / 1000.0);
+      else
+       {
+         CHECK_NUMBER (seconds);
+         seconds = make_float (XINT (millisec) / 1000.0 + XINT (seconds));
+       }
+    }
+
   if (!NILP (seconds))
     {
       if (INTEGERP (seconds))
@@ -3924,19 +3937,6 @@
       else
        wrong_type_argument (Qnumberp, seconds);
 
-      if (INTEGERP (millisec))
-       {
-         int carry;
-         usecs += XINT (millisec) * 1000;
-         carry = usecs / 1000000;
-         secs += carry;
-         if ((usecs -= carry * 1000000) < 0)
-           {
-             secs--;
-             usecs += 1000000;
-           }
-       }
-
       if (secs < 0 || (secs == 0 && usecs == 0))
        secs = -1, usecs = 0;
     }
@@ -4475,7 +4475,10 @@
                break;
 
               if (0 < nread)
+                {
                 total_nread += nread;
+                 got_some_input = 1;
+               }
 #ifdef EIO
              else if (nread == -1 && EIO == errno)
                 break;




reply via email to

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