Patch #: 152 Type: operational change Priority: none Modification: re-work handling of wait() calls for portability Submitted: Nick Kisseberth Archived: munnari.OZ.AU mac/cap.patches/cap60.patch152 Application: 'cd cap60; patch -p < cap60.patches/cap60.patch152' File: cap60/netat/sysvcompat.h.orig File: cap60/applications/aufs/afpos.c File: cap60/applications/aufs/aufs.c File: cap60/applications/lwsrv/lwsrv.c File: cap60/applications/papif/papif.c File: cap60/samples/isrv.c File: cap60/contrib/AsyncATalk/async.c File: cap60/contrib/Messages/macuser.c *** netat/sysvcompat.h.orig Sat Aug 1 23:33:30 1992 --- netat/sysvcompat.h Fri Aug 6 01:49:20 1993 *************** *** 1,8 **** /* ! * $Author: djh $ $Date: 1992/08/01 13:33:20 $ ! * $Header: /mac/src/cap60/netat/RCS/sysvcompat.h,v 2.6 1992/08/01 13:33:20 djh Rel djh $ ! * $Revision: 2.6 $ ! */ /* * sysvcompat.h - header file to allow us to port to sys v system machines --- 1,9 ---- /* ! * $Author: djh $ $Date: 1993/08/05 15:49:04 $ ! * $Header: /mac/src/cap60/netat/RCS/sysvcompat.h,v 2.7 1993/08/05 15:49:04 djh Rel djh $ ! * $Revision: 2.7 $ ! * ! */ /* * sysvcompat.h - header file to allow us to port to sys v system machines *************** *** 25,31 **** /* * Mappings from bsd to sysv string and bytestring function * ! */ #ifdef hpux # define B2S_STRING_MAPON /* map strings */ # define B2S_BSTRING_MAPON /* map byte string instructions */ --- 26,33 ---- /* * Mappings from bsd to sysv string and bytestring function * ! */ ! #ifdef hpux # define B2S_STRING_MAPON /* map strings */ # define B2S_BSTRING_MAPON /* map byte string instructions */ *************** *** 46,52 **** # define USERAND /* use srand, rand */ # define USEGETCWD /* use getcwd instead of bsd getwd */ # define NOUTIMES /* no utimes - use utime */ ! #endif #ifdef aux # define B2S_STRING_MAPON /* map strings */ --- 48,54 ---- # define USERAND /* use srand, rand */ # define USEGETCWD /* use getcwd instead of bsd getwd */ # define NOUTIMES /* no utimes - use utime */ ! #endif hpux #ifdef aux # define B2S_STRING_MAPON /* map strings */ *************** *** 55,61 **** # define USETIMES /* use times instead of getrusage */ # define USERAND /* use srand, rand */ # define NOVFORK /* no vfork in system */ ! #endif #ifdef uts # define USETIMES /* getrusage - "use times not rusage" */ --- 57,63 ---- # define USETIMES /* use times instead of getrusage */ # define USERAND /* use srand, rand */ # define NOVFORK /* no vfork in system */ ! #endif aux #ifdef uts # define USETIMES /* getrusage - "use times not rusage" */ *************** *** 93,100 **** --- 95,110 ---- # define MAXPATHLEN 256 /* a guess! */ # define NGROUPS 1 /* max number of groups per process */ # define NOSIGMASK /* setsigmask() et al not available */ + # define L_SET 0 + # define L_INCR 1 + # define L_XTND 2 #endif xenix5 + #ifdef drsnx + #define USESYSVLP + #define USEDIRENT + #endif drsnx + /* FIXED CONFIGURATION -- ALL NEW CONFIGURATIONS MUST PRECEED */ /* map sigcld to sigchld if sigchld isn't there */ *************** *** 101,142 **** #ifndef SIGCHLD # ifdef SIGCLD # define SIGCHLD SIGCLD ! # endif ! #endif #ifdef B2S_STRING_MAPON # ifndef USESTRINGDOTH # define USESTRINGDOTH /* must use string.h */ ! # endif # define index(s,c) strchr((char *)(s),(c)) # define rindex(s,c) strrchr((char *)(s),(c)) ! #endif #ifdef B2S_BSTRING_MAPON # define bcopy(s,d,l) memcpy((char *)(d),(char *)(s),(l)) # define bcmp(b1,b2,l) memcmp((char *)(b1),(char *)(b2),(l)) # define bzero(b,l) memset((char *)(b),0,(l)) ! #endif ! #ifdef NOWAIT3 ! # define WIFSTOPPED(status) (((status) & 0xff) == 0177) ! # define WIFSIGNALED(status) (((status) & 0177) != 0) ! # define W_TERMSIG(status) ((status) & 0177) ! # define W_COREDUMP(status) ((status) & 0200) ! # define W_RETCODE(status) ((status) >> 8) ! #else ! # define W_TERMSIG(status) (status).w_termsig ! # define W_COREDUMP(status) (status).w_coredump ! # define W_RETCODE(status) (status).w_retcode ! #endif ! #ifdef xenix5 ! #define L_SET 0 ! #define L_INCR 1 ! #define L_XTND 2 ! #endif xenix5 ! #ifdef drsnx ! #define USESYSVLP ! #define USEDIRENT ! #endif drsnx --- 111,189 ---- #ifndef SIGCHLD # ifdef SIGCLD # define SIGCHLD SIGCLD ! # endif SIGCLD ! #endif SIGCHLD #ifdef B2S_STRING_MAPON # ifndef USESTRINGDOTH # define USESTRINGDOTH /* must use string.h */ ! # endif USESTRINGDOTH # define index(s,c) strchr((char *)(s),(c)) # define rindex(s,c) strrchr((char *)(s),(c)) ! #endif B2S_STRING_MAPON #ifdef B2S_BSTRING_MAPON # define bcopy(s,d,l) memcpy((char *)(d),(char *)(s),(l)) # define bcmp(b1,b2,l) memcmp((char *)(b1),(char *)(b2),(l)) # define bzero(b,l) memset((char *)(b),0,(l)) ! #endif B2S_BSTRING_MAPON ! /* ! * WAIT/WAIT3 Compatibility Section ! * ! * We should allow the system to define the WIF macros if possible. ! * It's not our place to do so unless we have to, even then ! * it is somewhat dubious... should be done per machine, especially ! * the W_COREDUMP() macro. ! * ! * If your system uses (union wait) as its status parameter it ! * is a bit out of touch with modern times. Nevertheless ! * add "#define WSTATUS union wait" under a conditional ! * for your machine in the code above. ! * ! * We have NO guarantee that if the system doesn't define these ! * (or their POSIX/SYSV equivalents) that the ones we define ! * WILL work. It is up to the person porting this code to ! * determine this and define the functions beforehand to ! * do something else if their functionality is not supported ! * by your system. ! * ! */ ! #include ! #ifndef WSTATUS ! #define WSTATUS int ! #endif WSTATUS ! ! #ifndef WIFSTOPPED ! #define WIFSTOPPED(status) ((*((int *)&status) & 0xff) == 0177) ! #endif WIFSTOPPED ! ! #ifndef WIFSIGNALED ! #define WIFSIGNALED(status) ((*((int *)&status) & 0177) != 0) ! #endif WIFSIGNALED ! ! #ifndef W_TERMSIG ! #ifdef WTERMSIG ! #define W_TERMSIG WTERMSIG ! #else WTERMSIG ! #define W_TERMSIG(status) (*((int *)&status) & 0177) ! #endif WTERMSIG ! #endif W_TERMSIG ! ! #ifndef W_COREDUMP ! #ifdef WCOREDUMP ! #define W_COREDUMP WCOREDUMP ! #else WCOREDUMP ! #define W_COREDUMP(status) (*((int *)&status) & 0200) ! #endif WCOREDUMP ! #endif W_COREDUMP ! ! #ifndef W_RETCODE ! #ifdef WEXITSTATUS ! #define W_RETCODE WEXITSTATUS ! #else WEXITSTATUS ! #define W_RETCODE(status) (*((int *)&status) >> 8) ! #endif WEXITSTATUS ! #endif W_RETCODE *** applications/aufs/afpos.c.orig Sun May 30 11:37:56 1993 --- applications/aufs/afpos.c Fri Aug 6 01:50:43 1993 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1993/05/30 01:37:40 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpos.c,v 2.32 1993/05/30 01:37:40 djh Rel djh $ ! * $Revision: 2.32 $ */ /* --- 1,7 ---- /* ! * $Author: djh $ $Date: 1993/08/05 15:50:29 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpos.c,v 2.33 1993/08/05 15:50:29 djh Rel djh $ ! * $Revision: 2.33 $ */ /* *************** *** 3704,3710 **** { char gid[20]; /* big enough */ int pid, npid; ! int status; #ifndef USECHOWN struct stat stb; OSErr err; --- 3704,3710 ---- { char gid[20]; /* big enough */ int pid, npid; ! WSTATUS status; #ifndef USECHOWN struct stat stb; OSErr err; *** applications/aufs/aufs.c.orig Wed Aug 4 02:20:14 1993 --- applications/aufs/aufs.c Fri Aug 6 01:50:46 1993 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1993/08/03 16:20:06 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/aufs.c,v 2.18 1993/08/03 16:20:06 djh Rel djh $ ! * $Revision: 2.18 $ */ /* --- 1,7 ---- /* ! * $Author: djh $ $Date: 1993/08/05 15:50:29 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/aufs.c,v 2.19 1993/08/05 15:50:29 djh Rel djh $ ! * $Revision: 2.19 $ */ /* *************** *** 43,66 **** #include #include "afps.h" /* server includes */ - #ifdef USETIMES - # include - #endif - - #ifndef NOWAIT3 - # include - #endif - #ifdef USESTRINGDOTH # include ! #else # include ! #endif #ifdef USEVPRINTF # include ! #endif #ifdef NOPGRP # ifdef xenix5 # define killpg(pid,sig) kill(-(pid),sig) --- 43,62 ---- #include #include "afps.h" /* server includes */ #ifdef USESTRINGDOTH # include ! #else USESTRINGDOTH # include ! #endif USESTRINGDOTH #ifdef USEVPRINTF # include ! #endif USEVPRINTF + #ifndef NOWAIT3 + # define DORUSAGE + #endif NOWAIT3 + #ifdef NOPGRP # ifdef xenix5 # define killpg(pid,sig) kill(-(pid),sig) *************** *** 67,73 **** # else xenix5 # define NOSHUTDOWNCODE # endif xenix5 ! #endif /* known attention codes */ #define AFPSHUTDOWNTIME(x) (0x8000|((x)&0xfff)) --- 63,69 ---- # else xenix5 # define NOSHUTDOWNCODE # endif xenix5 ! #endif NOPGRP /* known attention codes */ #define AFPSHUTDOWNTIME(x) (0x8000|((x)&0xfff)) *************** *** 124,136 **** private int minutes_to_shutdown = -1; #endif NOSHUTDOWNCODE; - /* if wait3 and usetimes isn't set, then we handle rusage from wait3 */ - #ifndef NOWAIT3 - # ifndef USETIMES - # define DORUSAGE - # endif - #endif - /* * CNO TO PID handling * --- 120,125 ---- *************** *** 162,175 **** #define CP_TIMEDOUT 0x4 /* tickle timeout on inferior */ int pid; /* recorded pid */ long timeval; /* time when pid died */ ! #ifdef NOWAIT3 ! int status; ! #else ! union wait status; ! #endif #ifdef DORUSAGE struct rusage rusage; ! #endif } CTP, *CTPP; private struct cno_to_pid *ctp_tab; --- 151,160 ---- #define CP_TIMEDOUT 0x4 /* tickle timeout on inferior */ int pid; /* recorded pid */ long timeval; /* time when pid died */ ! WSTATUS status; #ifdef DORUSAGE struct rusage rusage; ! #endif DORUSAGE } CTP, *CTPP; private struct cno_to_pid *ctp_tab; *************** *** 1062,1078 **** void inferiordone() { ! #ifndef NOWAIT3 ! union wait status; ! #else ! int status; ! #endif #ifdef DORUSAGE struct rusage rusage; # define RUSAGEVAR &rusage ! #else # define RUSAGEVAR 0 /* may not be used, but.. */ ! #endif int pid; int i; struct cno_to_pid *cp; --- 1047,1059 ---- void inferiordone() { ! WSTATUS status; #ifdef DORUSAGE struct rusage rusage; # define RUSAGEVAR &rusage ! #else DORUSAGE # define RUSAGEVAR 0 /* may not be used, but.. */ ! #endif DORUSAGE int pid; int i; struct cno_to_pid *cp; *************** *** 1079,1087 **** #ifndef NOWAIT3 # define DOWAIT while ((pid=wait3(&status, WNOHANG, RUSAGEVAR)) > 0) ! #else # define DOWAIT if ((pid=wait(&status)) > 0) ! #endif DOWAIT { /* remember for later */ for (i = 0, cp = ctp_tab; i < maxsess; i++, cp++) { --- 1060,1069 ---- #ifndef NOWAIT3 # define DOWAIT while ((pid=wait3(&status, WNOHANG, RUSAGEVAR)) > 0) ! #else NOWAIT3 # define DOWAIT if ((pid=wait(&status)) > 0) ! #endif NOWAIT3 ! DOWAIT { /* remember for later */ for (i = 0, cp = ctp_tab; i < maxsess; i++, cp++) { *************** *** 1145,1154 **** if (cp->state & CP_TIMEDOUT) { logit(0,"process %d, session %d was terminated due to a timeout", cp->pid, srn); ! } else if (WIFSTOPPED(cp->status.w_status)) { logit(0,"process %d, session %d was suspended! gads what is happening?", cp->pid, srn); ! } else if (WIFSIGNALED(cp->status.w_status)) { SPAttention(srn, AFPSHUTDOWNNOW, 1, -1, &comp); while (comp > 0) {abSleep(30, TRUE);} /* ignore error */ SPCloseSession(srn, 3, 2, &comp); /* try 3 times every .5 seconds */ --- 1127,1136 ---- if (cp->state & CP_TIMEDOUT) { logit(0,"process %d, session %d was terminated due to a timeout", cp->pid, srn); ! } else if (WIFSTOPPED(cp->status)) { logit(0,"process %d, session %d was suspended! gads what is happening?", cp->pid, srn); ! } else if (WIFSIGNALED(cp->status)) { SPAttention(srn, AFPSHUTDOWNNOW, 1, -1, &comp); while (comp > 0) {abSleep(30, TRUE);} /* ignore error */ SPCloseSession(srn, 3, 2, &comp); /* try 3 times every .5 seconds */ *** applications/lwsrv/lwsrv.c.orig Wed Aug 4 02:21:10 1993 --- applications/lwsrv/lwsrv.c Fri Aug 6 01:51:58 1993 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1993/08/03 16:21:06 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/lwsrv.c,v 2.30 1993/08/03 16:21:06 djh Rel djh $"; ! static char revision[] = "$Revision: 2.30 $"; /* * lwsrv - UNIX AppleTalk spooling program: act as a laserwriter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1993/08/05 15:51:52 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/lwsrv.c,v 2.31 1993/08/05 15:51:52 djh Rel djh $"; ! static char revision[] = "$Revision: 2.31 $"; /* * lwsrv - UNIX AppleTalk spooling program: act as a laserwriter *************** *** 57,68 **** #else USESTRINGDOTH # include #endif USESTRINGDOTH ! #ifndef NOWAIT3 ! # include ! #endif NOWAIT3 #ifdef NEEDFCNTLDOTH # include #endif NEEDFCNTLDOTH #include "papstream.h" #if defined (LWSRV_AUFS_SECURITY) | defined (RUN_AS_USER) --- 57,67 ---- #else USESTRINGDOTH # include #endif USESTRINGDOTH ! #ifdef NEEDFCNTLDOTH # include #endif NEEDFCNTLDOTH + #include "papstream.h" #if defined (LWSRV_AUFS_SECURITY) | defined (RUN_AS_USER) *************** *** 390,408 **** private void childdone() { ! #ifndef NOWAIT3 ! union wait status; ! while (wait3(&status, WNOHANG, 0) > 0) ; ! signal(SIGCHLD, childdone); ! #else NOWAIT3 ! int status; (void)wait(&status); signal(SIGCHLD, childdone); - #endif NOWAIT3 } /* * delete the NBP name */ private int is_child = 0; --- 389,403 ---- private void childdone() { ! WSTATUS status; ! (void)wait(&status); signal(SIGCHLD, childdone); } /* * delete the NBP name + * */ private int is_child = 0; *************** *** 870,882 **** #ifdef NeXT char dpistring[6]; #endif NeXT - #ifdef WIFEXITED - int waitret; - union wait waitstatus; - #endif WIFEXITED #ifdef RUN_AS_USER int uid; #endif RUN_AS_USER #ifdef AUTHENTICATE register PAPSOCKET *ps; register unsigned net; --- 865,877 ---- #ifdef NeXT char dpistring[6]; #endif NeXT #ifdef RUN_AS_USER int uid; #endif RUN_AS_USER + + int waitret; + WSTATUS waitstatus; + #ifdef AUTHENTICATE register PAPSOCKET *ps; register unsigned net; *************** *** 1166,1220 **** perror("fork"); break; default: ! #ifdef WIFEXITED /* * This code is important, since lwsrv relies upon lpr to remove * the temporary files, we must remove them if lpr fails for any ! * reason (unless rflag TRUE). We need the System V equivalent below. * */ ! waitret = wait(&waitstatus); /* wait for the lpr to do its thing */ ! if (waitret == -1 ) { perror("wait"); exit(-1); } #ifdef hpux if (!rflag) unlink(tname); #else hpux ! if (WIFEXITED(waitstatus.w_status)) { ! if ( (int) waitstatus.w_retcode != 0 ) { fprintf(stderr,"lpr exited with status %d, %sremoving %s\n", ! (int) waitstatus.w_retcode, (rflag)?"not ":"",tname); ! if (!rflag) ! unlink(tname); } } #endif hpux - #else WIFEXITED - /* wait for the lpr to do its thing; using System V wait syntax */ - { int status, retval, exitval; - retval = wait(&status); - if (retval == -1 ) { - #ifdef UTS - status = 0; /* wait can return early */ - #else UTS - perror("wait"); - exit(-1); - #endif UTS - } - status &= 0x0000ffff; - if ( !(status & 0x000000ff) ) { - exitval = status & 0x0000ff00; - if ( exitval != 0 ) { - fprintf(stderr,"lpr exited with status %d, %sremoving %s\n", - exitval, (rflag)?"not ":"",tname); - if (!rflag) - unlink(tname); - } - } - } - #endif WIFEXITED break; } } --- 1161,1198 ---- perror("fork"); break; default: ! /* * This code is important, since lwsrv relies upon lpr to remove * the temporary files, we must remove them if lpr fails for any ! * reason (unless rflag TRUE). * */ ! ! /* wait for the lpr to do its thing */ ! ! if ((waitret = wait(&waitstatus)) == -1 ) { ! #ifdef UTS ! waitstatus = 0; /* wait can return early */ ! #else UTS perror("wait"); exit(-1); + #endif UTS } + #ifdef hpux if (!rflag) unlink(tname); #else hpux ! if (WIFEXITED(waitstatus)) { ! if (WEXITSTATUS(waitstatus) != 0 ) { fprintf(stderr,"lpr exited with status %d, %sremoving %s\n", ! WEXITSTATUS(waitstatus), (rflag) ? "not " : "", tname); ! if (!rflag) ! unlink(tname); } } #endif hpux break; } } *** applications/papif/papif.c.orig Wed Aug 4 02:21:42 1993 --- applications/papif/papif.c Fri Aug 6 01:52:38 1993 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1993/08/03 16:21:37 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/papif/RCS/papif.c,v 2.12 1993/08/03 16:21:37 djh Rel djh $"; ! static char revision[] = "$Revision: 2.12 $"; /* * papif - UNIX AppleTalk test program: simple line printer input filter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1993/08/05 15:52:31 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/papif/RCS/papif.c,v 2.13 1993/08/05 15:52:31 djh Rel djh $"; ! static char revision[] = "$Revision: 2.13 $"; /* * papif - UNIX AppleTalk test program: simple line printer input filter *************** *** 40,48 **** #include /* include appletalk definitions */ #include - #ifndef NOWAIT3 - # include - #endif NOWAIT3 #ifdef USESTRINGDOTH # include #else USESTRINGDOTH --- 40,45 ---- *************** *** 62,68 **** #ifndef CAPPRINTERS # define CAPPRINTERS "/etc/cap.printers" ! #endif /* * status watch time: minimum time to wait before doing next status --- 59,65 ---- #ifndef CAPPRINTERS # define CAPPRINTERS "/etc/cap.printers" ! #endif CAPPRINTERS /* * status watch time: minimum time to wait before doing next status *************** *** 687,721 **** /* * reaper (grim &) - deal with death of children * ! */ void reaper() { ! #ifdef NOWAIT3 ! int status; ! #else /* have WAIT3 */ ! union wait status; ! #endif /* NOWAIT3 */ register int i; #ifdef NOWAIT3 if ((i = wait(&status)) == 0) { ! log_w("papif: SIGCHLD but nothing from wait3\n"); return; } ! #else if ((i = wait3(&status, WNOHANG, 0)) == 0) { log_w("papif: SIGCHLD but nothing from wait3\n"); return; } ! #endif ! if (WIFSTOPPED(status.w_status)) { log_e("papif: Child %d stopped!\n", i); exit(lpd_REPRINT); } ! if (WIFSIGNALED(status.w_status)) { i = W_TERMSIG(status); if (i != SIGINT && i != SIGTERM) { log_e("papif: Child killed by signal %d\n", i); --- 684,722 ---- /* * reaper (grim &) - deal with death of children * ! */ ! void reaper() { ! WSTATUS status; register int i; + #ifdef POSIX + if ((i = waitpid(-1, &status, WNOHANG)) == 0) { + log_w("papif: SIGCHLD but nothing from waitpid\n"); + return; + } + #else POSIX #ifdef NOWAIT3 if ((i = wait(&status)) == 0) { ! log_w("papif: SIGCHLD but nothing from wait\n"); return; } ! #else NOWAIT3 if ((i = wait3(&status, WNOHANG, 0)) == 0) { log_w("papif: SIGCHLD but nothing from wait3\n"); return; } ! #endif NOWAIT3 ! #endif POSIX ! if (WIFSTOPPED(status)) { log_e("papif: Child %d stopped!\n", i); exit(lpd_REPRINT); } ! if (WIFSIGNALED(status)) { i = W_TERMSIG(status); if (i != SIGINT && i != SIGTERM) { log_e("papif: Child killed by signal %d\n", i); *** samples/isrv.c.orig Thu Jul 30 20:03:12 1992 --- samples/isrv.c Fri Aug 6 01:53:21 1993 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1992/07/30 10:03:04 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/samples/RCS/isrv.c,v 2.3 1992/07/30 10:03:04 djh Rel djh $"; ! static char revision[] = "$Revision: 2.3 $"; /* * isrv - UNIX AppleTalk test program: act as a laserwriter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1993/08/05 15:53:17 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/samples/RCS/isrv.c,v 2.4 1993/08/05 15:53:17 djh Rel djh $"; ! static char revision[] = "$Revision: 2.4 $"; /* * isrv - UNIX AppleTalk test program: act as a laserwriter *************** *** 27,40 **** #include #include /* include appletalk definitions */ - #ifndef NOWAIT3 - # include - #endif #ifdef USESTRINGDOTH # include ! #else # include ! #endif int cno; #define RFLOWQ 8 --- 27,37 ---- #include #include /* include appletalk definitions */ #ifdef USESTRINGDOTH # include ! #else USESTRINGDOTH # include ! #endif USESTRINGDOTH int cno; #define RFLOWQ 8 *************** *** 41,47 **** #define BUFMAX 512*RFLOWQ #ifndef SFLOWQ # define SFLOWQ 8 ! #endif #define SBUFMAX 512*SFLOWQ char rbuf[BUFMAX+10]; int xdebug = TRUE; --- 38,44 ---- #define BUFMAX 512*RFLOWQ #ifndef SFLOWQ # define SFLOWQ 8 ! #endif SFLOWQ #define SBUFMAX 512*SFLOWQ char rbuf[BUFMAX+10]; int xdebug = TRUE; *************** *** 211,226 **** void childdone() { ! #ifndef NOWAIT3 ! union wait status; ! while (wait3(&status, WNOHANG, 0) > 0) ; ! signal(SIGCHLD, childdone); ! #else ! int status; (void)wait(&status); signal(SIGCHLD, childdone); - #endif } /* --- 208,217 ---- void childdone() { ! WSTATUS status; (void)wait(&status); signal(SIGCHLD, childdone); } /* *** contrib/AsyncATalk/async.c.orig Thu Feb 28 23:45:22 1991 --- contrib/AsyncATalk/async.c Fri Aug 6 01:54:01 1993 *************** *** 1,7 **** /* ! * $Date: 91/02/15 21:20:58 $ ! * $Header: async.c,v 2.1 91/02/15 21:20:58 djh Rel $ ! * $Log: async.c,v $ * Revision 2.1 91/02/15 21:20:58 djh * CAP 6.0 Initial Revision * --- 1,10 ---- /* ! * $Date: 1993/08/05 15:53:56 $ ! * $Header: /mac/src/cap60/contrib/AsyncATalk/RCS/async.c,v 2.2 1993/08/05 15:53:56 djh Rel djh $ ! * $Log: async.c,v $ ! * Revision 2.2 1993/08/05 15:53:56 djh ! * change wait handling ! * * Revision 2.1 91/02/15 21:20:58 djh * CAP 6.0 Initial Revision * *************** *** 1324,1333 **** int funeral() { ! int junk; serOpen = 0; ! while(wait3(&junk, WNOHANG, 0) > 0) ! ; close(p); } --- 1327,1345 ---- int funeral() { ! WSTATUS junk; serOpen = 0; ! #ifdef POSIX ! while( waitpid(-1, &junk, WNOHANG) > 0 ) ! ; ! #else POSIX ! #ifndef NOWAIT3 ! while( wait3(&junk, WNOHANG, 0) > 0 ) ! ; ! #else NOWAIT3 ! wait(&junk); /* assume there is at least one process to wait for */ ! #endif NOWAIT3 ! #endif POSIX close(p); } *** contrib/Messages/macuser.c.orig Thu Mar 14 14:21:18 1991 --- contrib/Messages/macuser.c Fri Aug 6 01:54:30 1993 *************** *** 1,7 **** /* ! * $Date: 91/03/14 14:20:25 $ ! * $Header: macuser.c,v 2.2 91/03/14 14:20:25 djh Exp $ ! * $Log: macuser.c,v $ * Revision 2.2 91/03/14 14:20:25 djh * Fall back to log(), don't write non-ascii on a terminal, * handle Sys V utmp files. --- 1,10 ---- /* ! * $Date: 1993/08/05 15:54:23 $ ! * $Header: /mac/src/cap60/contrib/Messages/RCS/macuser.c,v 2.3 1993/08/05 15:54:23 djh Rel djh $ ! * $Log: macuser.c,v $ ! * Revision 2.3 1993/08/05 15:54:23 djh ! * change wait handling ! * * Revision 2.2 91/03/14 14:20:25 djh * Fall back to log(), don't write non-ascii on a terminal, * handle Sys V utmp files. *************** *** 385,394 **** int funeral() { ! int junk; while(wait3(&junk, WNOHANG, 0) > 0) ! ; } /* --- 388,406 ---- int funeral() { ! WSTATUS junk; + #ifdef POSIX + while(waitpid(-1,&junk, WNOHANG) > 0) + ; + #else POSIX + #ifndef NOWAIT3 while(wait3(&junk, WNOHANG, 0) > 0) ! ; ! #else NOWAIT3 ! wait(&junk); /* assume there is at least one process to wait for */ ! #endif NOWAIT3 ! #endif POSIX } /* *** lib/cap/abversion.c.orig Thu Aug 5 01:29:10 1993 --- lib/cap/abversion.c Fri Aug 6 01:55:31 1993 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1993/08/04 15:29:04 $ ! * $Header: /mac/src/cap60/lib/cap/RCS/abversion.c,v 2.51 1993/08/04 15:29:04 djh Rel djh $ ! * $Revision: 2.51 $ */ /* --- 1,7 ---- /* ! * $Author: djh $ $Date: 1993/08/05 15:55:26 $ ! * $Header: /mac/src/cap60/lib/cap/RCS/abversion.c,v 2.52 1993/08/05 15:55:26 djh Rel djh $ ! * $Revision: 2.52 $ */ /* *************** *** 31,37 **** myversion.cv_name = "CAP"; myversion.cv_version = 6; myversion.cv_subversion = 0; ! myversion.cv_patchlevel = 151; myversion.cv_rmonth = "August"; myversion.cv_ryear = "1993"; switch (lap_proto) { --- 31,37 ---- myversion.cv_name = "CAP"; myversion.cv_version = 6; myversion.cv_subversion = 0; ! myversion.cv_patchlevel = 152; myversion.cv_rmonth = "August"; myversion.cv_ryear = "1993"; switch (lap_proto) { *** README.orig Thu Aug 5 01:30:24 1993 --- README Fri Aug 6 01:56:35 1993 *************** *** 2,8 **** CAP - Columbia AppleTalk Package for UNIX o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 151, August 1993 Notice ------ --- 2,8 ---- CAP - Columbia AppleTalk Package for UNIX o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 152, August 1993 Notice ------