Page MenuHomeFreeBSD

D17035.id47677.diff
No OneTemporary

D17035.id47677.diff

Index: sbin/mdmfs/mdmfs.c
===================================================================
--- sbin/mdmfs/mdmfs.c
+++ sbin/mdmfs/mdmfs.c
@@ -674,8 +674,12 @@
* Run a process with command name and arguments pointed to by the
* formatted string 'cmdline'. Since system(3) is not used, the first
* space-delimited token of 'cmdline' must be the full pathname of the
- * program to run. The return value is the return code of the process
- * spawned. If 'ofd' is non-NULL, it is set to the standard output of
+ * program to run.
+ *
+ * The return value is the return code of the process spawned, or a negative
+ * signal number, if the process exited due to an uncaught signal.
+ *
+ * If 'ofd' is non-NULL, it is set to the standard output of
* the program spawned (i.e., you can read from ofd and get the output
* of the program).
*/
@@ -771,7 +775,12 @@
free(argv);
while (waitpid(pid, &status, 0) != pid)
;
- return (WEXITSTATUS(status));
+ if (WIFEXITED(status))
+ return (WEXITSTATUS(status));
+ else if (WIFSIGNALED(status))
+ return (-WTERMSIG(status));
+ else
+ err(1, "unexpected waitpid status: 0x%x", status);
}
static void

File Metadata

Mime Type
text/plain
Expires
Sun, Apr 19, 5:52 AM (17 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31749499
Default Alt Text
D17035.id47677.diff (1 KB)

Event Timeline