emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r111113: Minor call-process cleanups.


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111113: Minor call-process cleanups.
Date: Wed, 05 Dec 2012 10:29:52 -0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111113
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Wed 2012-12-05 10:29:52 -0800
message:
  Minor call-process cleanups.
  
  * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
  at the same time as other platforms, to simplify analysis.
  No need for fd0_volatile since we have synch_process_fd.
  Avoid needless emacs_close; arg is always negative.
modified:
  src/ChangeLog
  src/callproc.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-12-04 21:18:37 +0000
+++ b/src/ChangeLog     2012-12-05 18:29:52 +0000
@@ -1,3 +1,11 @@
+2012-12-05  Paul Eggert  <address@hidden>
+
+       Minor call-process cleanups.
+       * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
+       at the same time as other platforms, to simplify analysis.
+       No need for fd0_volatile since we have synch_process_fd.
+       Avoid needless emacs_close; arg is always negative.
+
 2012-12-04  Andreas Schwab  <address@hidden>
 
        * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous

=== modified file 'src/callproc.c'
--- a/src/callproc.c    2012-12-04 21:18:37 +0000
+++ b/src/callproc.c    2012-12-05 18:29:52 +0000
@@ -579,13 +579,20 @@
       }
     else
       fd0 = -1; /* We are not going to read from tempfile.   */
-#else /* not MSDOS */
+#endif /* MSDOS */
 
     /* Do the unwind-protect now, even though the pid is not known, so
        that no storage allocation is done in the critical section.
        The actual PID will be filled in during the critical section.  */
     synch_process_pid = 0;
     synch_process_fd = fd0;
+
+#ifdef MSDOS
+    /* MSDOS needs different cleanup information.  */
+    record_unwind_protect (call_process_cleanup,
+                          Fcons (Fcurrent_buffer (),
+                                 build_string (tempfile ? tempfile : "")));
+#else
     record_unwind_protect (call_process_cleanup, Fcurrent_buffer ());
 
     block_input ();
@@ -603,7 +610,6 @@
       bool volatile display_p_volatile = display_p;
       bool volatile output_to_buffer_volatile = output_to_buffer;
       bool volatile sa_must_free_volatile = sa_must_free;
-      int volatile fd0_volatile = fd0;
       int volatile fd1_volatile = fd1;
       int volatile fd_error_volatile = fd_error;
       int volatile fd_output_volatile = fd_output;
@@ -621,7 +627,6 @@
       display_p = display_p_volatile;
       output_to_buffer = output_to_buffer_volatile;
       sa_must_free = sa_must_free_volatile;
-      fd0 = fd0_volatile;
       fd1 = fd1_volatile;
       fd_error = fd_error_volatile;
       fd_output = fd_output_volatile;
@@ -629,6 +634,8 @@
       count = count_volatile;
       sa_count = sa_count_volatile;
       new_argv = new_argv_volatile;
+
+      fd0 = synch_process_fd;
     }
 
     if (pid == 0)
@@ -682,18 +689,7 @@
     }
 
   if (INTEGERP (buffer))
-    {
-      if (fd0 >= 0)
-       emacs_close (fd0);
-      return unbind_to (count, Qnil);
-    }
-
-#if defined (MSDOS)
-  /* MSDOS needs different cleanup information.  */
-  record_unwind_protect (call_process_cleanup,
-                        Fcons (Fcurrent_buffer (),
-                               build_string (tempfile ? tempfile : "")));
-#endif
+    return unbind_to (count, Qnil);
 
   if (BUFFERP (buffer))
     Fset_buffer (buffer);


reply via email to

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