head 1.3; access; symbols pkgsrc-2013Q2:1.3.0.54 pkgsrc-2013Q2-base:1.3 pkgsrc-2012Q4:1.3.0.52 pkgsrc-2012Q4-base:1.3 pkgsrc-2011Q4:1.3.0.50 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q2:1.3.0.48 pkgsrc-2011Q2-base:1.3 pkgsrc-2009Q4:1.3.0.46 pkgsrc-2009Q4-base:1.3 pkgsrc-2008Q4:1.3.0.44 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.42 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.40 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.38 pkgsrc-2008Q2-base:1.3 pkgsrc-2008Q1:1.3.0.36 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.34 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.32 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.30 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.28 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.3.0.26 pkgsrc-2006Q4-base:1.3 pkgsrc-2006Q3:1.3.0.24 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.22 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.20 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.18 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.3.0.16 pkgsrc-2005Q3-base:1.3 pkgsrc-2005Q2:1.3.0.14 pkgsrc-2005Q2-base:1.3 pkgsrc-2005Q1:1.3.0.12 pkgsrc-2005Q1-base:1.3 pkgsrc-2004Q4:1.3.0.10 pkgsrc-2004Q4-base:1.3 pkgsrc-2004Q3:1.3.0.8 pkgsrc-2004Q3-base:1.3 pkgsrc-2004Q2:1.3.0.6 pkgsrc-2004Q2-base:1.3 pkgsrc-2004Q1:1.3.0.4 pkgsrc-2004Q1-base:1.3 pkgsrc-2003Q4:1.3.0.2 pkgsrc-2003Q4-base:1.3 buildlink2-base:1.3 netbsd-1-3-PATCH002:1.2 Makefile:1.1.1.1 FreeBSD-current-1997-09-25:1.1.1.1 FREEBSD:1.1.1; locks; strict; comment @# @; 1.3 date 98.05.22.13.52.13; author frueauf; state dead; branches; next 1.2; 1.2 date 97.10.13.12.47.58; author agc; state Exp; branches; next 1.1; 1.1 date 97.10.11.21.55.01; author hubertf; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 97.10.11.21.55.01; author hubertf; state Exp; branches; next ; desc @@ 1.3 log @Make this work with MANZ and tidy up patchfiles; don't patch the same file in n patchfiles, just one per patch for better maintainance. @ text @*** Makefile.ORIG Fri Dec 13 16:26:46 1996 --- Makefile Sat Dec 14 11:01:06 1996 *************** *** 3,8 **** BINDIR= ${PREFIX}/bin MANDIR= ${PREFIX}/man ! CFLAGS+= -DHAVE_PARAM_H .include --- 3,8 ---- BINDIR= ${PREFIX}/bin MANDIR= ${PREFIX}/man ! CFLAGS+= -DHAVE_PARAM_H -DHAVE_WAIT_H .include *** team.c.ORIG Fri Dec 13 16:26:50 1996 --- team.c Sun Dec 15 10:35:10 1996 *************** *** 84,89 **** --- 84,92 ---- #include #include #include + #ifdef HAVE_WAIT_H + #include + #endif #ifdef HAVE_PARAM_H #include *************** *** 165,170 **** --- 168,174 ---- local bool verbose = false; local bool report = true; + local bool guyhaderror = false; extern int errno; local time_t origin; *************** *** 647,653 **** { mesg("team: guy pid %u: %s\n",guy->pid,errormsg); call GuySEND(guy,TokenABORT,FdERROR,0L); ! exit(1); /*NOTREACHED*/ } --- 651,657 ---- { mesg("team: guy pid %u: %s\n",guy->pid,errormsg); call GuySEND(guy,TokenABORT,FdERROR,0L); ! exit(2); /*NOTREACHED*/ } *************** *** 807,812 **** --- 811,819 ---- { pid = getpid(); + /* Set SIGPIPE handling back to the default in the guys */ + signal(SIGPIPE, SIG_DFL); + if (!FdClose(&last_downstream)) perror("cannot close inherited first link"); *************** *** 826,838 **** } } ! if (!StreamSend(&last_downstream,TokenREAD,FdOPEN,0L)) { perror("cannot send first READ token"); return false; } ! if (!StreamSend(&last_downstream,TokenWRITE,FdOPEN,0L)) { perror("cannot send first WRITE token"); return false; --- 833,845 ---- } } ! if (!StreamSend(&last_downstream,TokenREAD,FdOPEN,0L) && errno != EPIPE) { perror("cannot send first READ token"); return false; } ! if (!StreamSend(&last_downstream,TokenWRITE,FdOPEN,0L) && errno != EPIPE) { perror("cannot send first WRITE token"); return false; *************** *** 874,879 **** --- 881,894 ---- --team->active; + #ifdef WIFEXITED + /* If a guy had an error, its exit status is 2. Also catch a killed guy */ + if ((WIFEXITED(status) && WEXITSTATUS(status) == 2) || + (WIFSIGNALED(status) && WTERMSIG(status) != SIGPIPE)) { + guyhaderror = true; + } + #endif + if (status != 0 && team->active != 0) return false; } *************** *** 1042,1047 **** --- 1057,1067 ---- origin = time((time_t *) 0); + /* + * Ignore SIGPIPE in the parent as it affects the exit status reporting. + */ + signal(SIGPIPE, SIG_IGN); + if (!TeamStart(&team,bufsize,isize,osize)) { mesg("team: cannot start the team\n"); *************** *** 1062,1067 **** --- 1082,1093 ---- if (!TeamClose(&team)) { mesg("team: cannot close the team\n"); + return 1; + } + + if (guyhaderror) + { + mesg("team: guy had error\n"); return 1; } @ 1.2 log @Mark FreeBSD RCS Id as such. Make this compile on NetBSD: + __FreeBSD__ -> (defined(BSD) && BSD >= 199306) + eliminate compiler warnings by working around unusual definition in switch statement. + change the man directory location to reflect NetBSD reality. @ text @@ 1.1 log @Initial revision @ text @d6 1 a6 1 MANDIR= ${PREFIX}/man/man d13 1 a13 1 MANDIR= ${PREFIX}/man/man @ 1.1.1.1 log @Import as of 09/25/97 @ text @@