Simplify and avoid signal-handling races.
[bpt/emacs.git] / src / callproc.c
index 2604d29..fc3eb94 100644 (file)
@@ -582,7 +582,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
                       0, current_dir);
 #else  /* not WINDOWSNT */
 
-    BLOCK_INPUT;
+    block_input ();
 
     /* vfork, and prevent local vars from being clobbered by the vfork.  */
     {
@@ -626,15 +626,14 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
        setpgrp (pid, pid);
 #endif /* USG */
 
-       /* GConf causes us to ignore SIGPIPE, make sure it is restored
-          in the child.  */
+       /* Emacs ignores SIGPIPE, but the child should not.  */
        signal (SIGPIPE, SIG_DFL);
 
        child_setup (filefd, fd1, fd_error, (char **) new_argv,
                     0, current_dir);
       }
 
-    UNBLOCK_INPUT;
+    unblock_input ();
 
 #endif /* not WINDOWSNT */
 
@@ -976,9 +975,9 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
     {
       int fd;
 
-      BLOCK_INPUT;
+      block_input ();
       fd = mkstemp (tempfile);
-      UNBLOCK_INPUT;
+      unblock_input ();
       if (fd == -1)
        report_file_error ("Failed to open temporary file",
                           Fcons (build_string (tempfile), Qnil));