summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-10-22 10:56:47 +0000
committerEric Andersen <andersen@codepoet.org>2003-10-22 10:56:47 +0000
commita48b0a3af71958c1cea6389893371664a47b1a39 (patch)
tree59ed865eb6eb4b619257fc51fb19091ec5844d79 /shell
parent514633bf3f4f941d3ba1bb47cc46c31734574cf6 (diff)
downloadbusybox-w32-a48b0a3af71958c1cea6389893371664a47b1a39.tar.gz
busybox-w32-a48b0a3af71958c1cea6389893371664a47b1a39.tar.bz2
busybox-w32-a48b0a3af71958c1cea6389893371664a47b1a39.zip
last_patch116 from vodz:
Stephane, >Using busybox+uclibc, crond syslog messages look like: > >Oct 9 09:04:46 soekris cron.notice crond[347]: ^Icrond 2.3.2 dillon, >started, log level 8 Thanks for testing. >The attached patch corrects the problem. Your patch is not correct. Correct patch attached. Also. Last patch have - add "Broken pipe" message to ash.c - busybox ash synced with dash_0.4.18 --w vodz
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 8adf581b6..deffe28c5 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -6682,18 +6682,24 @@ sprint_status(char *s, int status, int sigonly)
6682 int st; 6682 int st;
6683 6683
6684 col = 0; 6684 col = 0;
6685 st = WEXITSTATUS(status);
6686 if (!WIFEXITED(status)) { 6685 if (!WIFEXITED(status)) {
6687 st = WTERMSIG(status);
6688#if JOBS 6686#if JOBS
6689 if (WIFSTOPPED(status)) 6687 if (WIFSTOPPED(status))
6690 st = WSTOPSIG(status); 6688 st = WSTOPSIG(status);
6689 else
6691#endif 6690#endif
6691 st = WTERMSIG(status);
6692 if (sigonly) { 6692 if (sigonly) {
6693 if (st == SIGINT || st == SIGPIPE) 6693 if(st == SIGPIPE) {
6694 col = fmtstr(s, 16, "Broken pipe");
6695 goto out;
6696 }
6697 if (st == SIGINT)
6694 goto out; 6698 goto out;
6699#if JOBS
6695 if (WIFSTOPPED(status)) 6700 if (WIFSTOPPED(status))
6696 goto out; 6701 goto out;
6702#endif
6697 } 6703 }
6698 st &= 0x7f; 6704 st &= 0x7f;
6699 col = fmtstr(s, 32, u_signal_names(NULL, &st, 0)); 6705 col = fmtstr(s, 32, u_signal_names(NULL, &st, 0));
@@ -6701,6 +6707,7 @@ sprint_status(char *s, int status, int sigonly)
6701 col += fmtstr(s + col, 16, " (core dumped)"); 6707 col += fmtstr(s + col, 16, " (core dumped)");
6702 } 6708 }
6703 } else if (!sigonly) { 6709 } else if (!sigonly) {
6710 st = WEXITSTATUS(status);
6704 if (st) 6711 if (st)
6705 col = fmtstr(s, 16, "Done(%d)", st); 6712 col = fmtstr(s, 16, "Done(%d)", st);
6706 else 6713 else
@@ -9036,18 +9043,19 @@ getopts(char *optstr, char *optvar, char **optfirst, int *param_optind, int *opt
9036 char c = '?'; 9043 char c = '?';
9037 int done = 0; 9044 int done = 0;
9038 int err = 0; 9045 int err = 0;
9039 char s[10]; 9046 char s[12];
9040 char **optnext = optfirst + *param_optind - 1; 9047 char **optnext;
9048
9049 if(*param_optind < 1)
9050 return 1;
9051 optnext = optfirst + *param_optind - 1;
9041 9052
9042 if (*param_optind <= 1 || *optoff < 0 || !(*(optnext - 1)) || 9053 if (*param_optind <= 1 || *optoff < 0 || strlen(optnext[-1]) < *optoff)
9043 strlen(*(optnext - 1)) < *optoff)
9044 p = NULL; 9054 p = NULL;
9045 else 9055 else
9046 p = *(optnext - 1) + *optoff; 9056 p = optnext[-1] + *optoff;
9047 if (p == NULL || *p == '\0') { 9057 if (p == NULL || *p == '\0') {
9048 /* Current word is done, advance */ 9058 /* Current word is done, advance */
9049 if (optnext == NULL)
9050 return 1;
9051 p = *optnext; 9059 p = *optnext;
9052 if (p == NULL || *p != '-' || *++p == '\0') { 9060 if (p == NULL || *p != '-' || *++p == '\0') {
9053atend: 9061atend: