utimens: cache whether utimensat syscall works
[pspp] / lib / wait-process.c
index 7db25e995de03bc73478dc3f57253babdc70a474..cf55ec19e90e64fa368e9620cfeeff7e696485e6 100644 (file)
@@ -1,5 +1,5 @@
 /* Waiting for a subprocess to finish.
-   Copyright (C) 2001-2003, 2005-2008 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2009 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -269,7 +269,7 @@ wait_subprocess (pid_t child, const char *progname,
       if (info.si_status == SIGPIPE && ignore_sigpipe)
        return 0;
 # endif
-      if (exit_on_error || !null_stderr)
+      if (exit_on_error || (!null_stderr && termsigp == NULL))
        error (exit_on_error ? EXIT_FAILURE : 0, 0,
               _("%s subprocess got fatal signal %d"),
               progname, info.si_status);
@@ -292,7 +292,7 @@ wait_subprocess (pid_t child, const char *progname,
 
   if (termsigp != NULL)
     *termsigp = 0;
-  *(int *) &status = 0;
+  status = 0;
   for (;;)
     {
       int result = waitpid (child, &status, 0);
@@ -308,7 +308,7 @@ wait_subprocess (pid_t child, const char *progname,
            {
              /* Child process nonexistent?! Assume it terminated
                 successfully.  */
-             *(int *) &status = 0;
+             status = 0;
              break;
            }
 # endif
@@ -341,7 +341,7 @@ wait_subprocess (pid_t child, const char *progname,
       if (WTERMSIG (status) == SIGPIPE && ignore_sigpipe)
        return 0;
 # endif
-      if (exit_on_error || !null_stderr)
+      if (exit_on_error || (!null_stderr && termsigp == NULL))
        error (exit_on_error ? EXIT_FAILURE : 0, 0,
               _("%s subprocess got fatal signal %d"),
               progname, (int) WTERMSIG (status));