HOST: Check for setitimer() failure.
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 7 Sep 2020 21:16:15 +0000 (14:16 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 7 Sep 2020 21:21:04 +0000 (14:21 -0700)
This is unlikely but it eliminates one possible problem during
debugging.

src/language/utilities/host.c

index 4a32d463973862739942190cae7cadccb5aa5739..1ab7cc1d02eef6a530ddd7159a3dcf342ad159af 100644 (file)
@@ -40,6 +40,7 @@
 #include "libpspp/temp-file.h"
 #include "output/text-item.h"
 
+#include "gl/error.h"
 #include "gl/intprops.h"
 #include "gl/localcharset.h"
 #include "gl/read-file.h"
@@ -136,7 +137,8 @@ run_command (const char *command, struct timespec timeout)
               .tv_usec = left.tv_nsec / 1000
             }
           };
-          setitimer (ITIMER_REAL, &it, NULL);
+          if (setitimer (ITIMER_REAL, &it, NULL) < 0)
+            error (1, errno, _("Failed to set timeout."));
         }
 
       /* Set up file descriptors: