replaced: "exit status not 0" with errstr() snarfed from wait(). Notes: Sun Feb 20 17:20:20 EST 2005 rsc Presumably you'd have to edit plan9.c to implement this? Reference: /n/sources/patch/sorry/sam-errstr Date: Sun Feb 20 08:39:53 CET 2005 Reviewed-by: rsc --- /sys/src/cmd/sam/sam.h Sun Feb 20 08:36:38 2005 +++ /sys/src/cmd/sam/sam.h Sun Feb 20 08:36:37 2005 @@ -323,7 +323,7 @@ void trytoquit(void); int undo(int); void update(void); -int waitfor(int); +char *waitfor(int); void warn(Warn); void warn_s(Warn, char*); void warn_SS(Warn, String*, String*); --- /sys/src/cmd/sam/shell.c Sun Feb 20 08:36:41 2005 +++ /sys/src/cmd/sam/shell.c Sun Feb 20 08:36:40 2005 @@ -14,8 +14,11 @@ long l; int m; int pid, fd; - int retcode; int pipe1[2], pipe2[2]; + int retcode; + char *retmsg; + + retcode = 0; if(s->s[0]==0 && plan9cmd.s[0]==0) error(Enocmd); @@ -115,10 +118,12 @@ bpipeok = 0; closeio((Posn)-1); } - retcode = waitfor(pid); + retmsg = waitfor(pid); if(type=='|' || type=='<') - if(retcode!=0) - warn(Wbadstatus); + if(retmsg!=nil) { + warn_s(Wbadstatus, retmsg); + retcode = -1; + } if(downloaded) checkerrs(); if(!nest) --- /sys/src/cmd/sam/error.c Sun Feb 20 08:36:44 2005 +++ /sys/src/cmd/sam/error.c Sun Feb 20 08:36:44 2005 @@ -63,7 +63,7 @@ "null characters elided", "can't run pwd", "last char not newline", - "exit status not 0", + "exit status not 0", /* replaced by errstr() */ }; void @@ -123,7 +123,7 @@ void warn_s(Warn s, char *a) { - dprint("?warning: %s `%s'\n", wmsg[s], a); + dprint("?warning: `%s'\n", s == Wbadstatus ? a : wmsg[s]); } void