Changeset View
Changeset View
Standalone View
Standalone View
head/sysutils/xe/files/patch-xe.c
--- xe.c.orig 2016-05-20 18:14:18 UTC | --- xe.c.orig 2017-04-13 15:28:38 UTC | ||||
+++ xe.c | +++ xe.c | ||||
@@ -13,6 +13,7 @@ | @@ -12,6 +12,7 @@ | ||||
#include <limits.h> | #include <limits.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
+#include <signal.h> | +#include <signal.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -100,7 +101,7 @@ mywait() | @@ -99,7 +100,7 @@ mywait() | ||||
} else if (WEXITSTATUS(status) > 125) { | } else if (WEXITSTATUS(status) > 125) { | ||||
exit(WEXITSTATUS(status)); | exit(WEXITSTATUS(status)); | ||||
} | } | ||||
- } else if (WIFSIGNALED(status)) { | - } else if (WIFSIGNALED(status)) { | ||||
+ } else if (WIFSIGNALED(status) && !(fflag && WTERMSIG(status) == SIGPIPE)) { | + } else if (WIFSIGNALED(status) && !(fflag && WTERMSIG(status) == SIGPIPE)) { | ||||
fprintf(stderr, "xe: pid %d terminated by signal %d\n", | fprintf(stderr, "xe: pid %d terminated by signal %d\n", | ||||
pid, WTERMSIG(status)); | pid, WTERMSIG(status)); | ||||
exit(125); | exit(125); | ||||
@@ -353,6 +354,7 @@ main(int argc, char *argv[], char *envp[ | @@ -358,6 +359,7 @@ main(int argc, char *argv[], char *envp[ | ||||
pusharg("/bin/sh"); | pusharg("/bin/sh"); | ||||
pusharg("-c"); | pusharg("-c"); | ||||
pusharg(sflag); | pusharg(sflag); | ||||
+ pusharg("--"); | + pusharg("--"); | ||||
pusharg("-"); | pusharg("-"); | ||||
} else if (optind >= cmdend) { | } else if (optind >= cmdend) { | ||||
pusharg("printf"); | pusharg("printf"); |