=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rdist/child.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- src/usr.bin/rdist/child.c 2001/11/19 19:02:15 1.10 +++ src/usr.bin/rdist/child.c 2002/06/12 06:07:16 1.11 @@ -1,4 +1,4 @@ -/* $OpenBSD: child.c,v 1.10 2001/11/19 19:02:15 mpech Exp $ */ +/* $OpenBSD: child.c,v 1.11 2002/06/12 06:07:16 mpech Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -39,7 +39,7 @@ "$From: child.c,v 6.28 1996/02/22 19:30:09 mcooper Exp $"; #else static char RCSid[] = -"$OpenBSD: child.c,v 1.10 2001/11/19 19:02:15 mpech Exp $"; +"$OpenBSD: child.c,v 1.11 2002/06/12 06:07:16 mpech Exp $"; #endif static char sccsid[] = "@(#)docmd.c 5.1 (Berkeley) 6/6/85"; @@ -91,8 +91,8 @@ { CHILD *pc, *prevpc; - debugmsg(DM_CALL, "removechild(%s, %d, %d) start", - child->c_name, child->c_pid, child->c_readfd); + debugmsg(DM_CALL, "removechild(%s, %ld, %d) start", + child->c_name, (long)child->c_pid, child->c_readfd); /* * Find the child in the list @@ -103,8 +103,8 @@ break; if (pc == NULL) - error("RemoveChild called with bad child %s %d %d", - child->c_name, child->c_pid, child->c_readfd); + error("RemoveChild called with bad child %s %ld %d", + child->c_name, (long)child->c_pid, child->c_readfd); else { /* * Remove the child @@ -177,8 +177,9 @@ ++activechildren; debugmsg(DM_MISC, - "addchild() created '%s' pid %d fd %d (active=%d)\n", - child->c_name, child->c_pid, child->c_readfd, activechildren); + "addchild() created '%s' pid %ld fd %d (active=%d)\n", + child->c_name, (long)child->c_pid, child->c_readfd, + activechildren); } /* @@ -190,15 +191,15 @@ char rbuf[BUFSIZ]; int amt; - debugmsg(DM_CALL, "[readchild(%s, %d, %d) start]", - child->c_name, child->c_pid, child->c_readfd); + debugmsg(DM_CALL, "[readchild(%s, %ld, %d) start]", + child->c_name, (long)child->c_pid, child->c_readfd); /* * Check that this is a valid child. */ if (child->c_name == NULL || child->c_readfd <= 0) { - debugmsg(DM_MISC, "[readchild(%s, %d, %d) bad child]", - child->c_name, child->c_pid, child->c_readfd); + debugmsg(DM_MISC, "[readchild(%s, %ld, %d) bad child]", + child->c_name, (long)child->c_pid, child->c_readfd); return; } @@ -207,24 +208,24 @@ */ while ((amt = read(child->c_readfd, rbuf, sizeof(rbuf))) > 0) { /* XXX remove these debug calls */ - debugmsg(DM_MISC, "[readchild(%s, %d, %d) got %d bytes]", - child->c_name, child->c_pid, child->c_readfd, amt); + debugmsg(DM_MISC, "[readchild(%s, %ld, %d) got %d bytes]", + child->c_name, (long)child->c_pid, child->c_readfd, amt); (void) xwrite(fileno(stdout), rbuf, amt); - debugmsg(DM_MISC, "[readchild(%s, %d, %d) write done]", - child->c_name, child->c_pid, child->c_readfd); + debugmsg(DM_MISC, "[readchild(%s, %ld, %d) write done]", + child->c_name, (long)child->c_pid, child->c_readfd); } - debugmsg(DM_MISC, "readchild(%s, %d, %d) done: amt = %d errno = %d\n", - child->c_name, child->c_pid, child->c_readfd, amt, errno); + debugmsg(DM_MISC, "readchild(%s, %ld, %d) done: amt = %d errno = %d\n", + child->c_name, (long)child->c_pid, child->c_readfd, amt, errno); /* * See if we've reached EOF */ if (amt == 0) - debugmsg(DM_MISC, "readchild(%s, %d, %d) at EOF\n", - child->c_name, child->c_pid, child->c_readfd); + debugmsg(DM_MISC, "readchild(%s, %ld, %d) at EOF\n", + child->c_name, (long)child->c_pid, child->c_readfd); } /* @@ -233,12 +234,13 @@ * a process does exit, then the pointer "statval" is set to the * exit status of the exiting process, if statval is not NULL. */ -static int waitproc(statval, block) +static pid_t waitproc(statval, block) int *statval; int block; { WAIT_ARG_TYPE status; - int pid, exitval; + int exitval; + pid_t pid; debugmsg(DM_CALL, "waitproc() %s, active children = %d...\n", (block) ? "blocking" : "nonblocking", activechildren); @@ -260,8 +262,8 @@ if (pid > 0 && exitval != 0) { nerrs++; debugmsg(DM_MISC, - "Child process %d exited with status %d.\n", - pid, exitval); + "Child process %ld exited with status %d.\n", + (long)pid, exitval); } if (statval) @@ -297,8 +299,8 @@ */ pid = waitproc(&status, FALSE); debugmsg(DM_MISC, - "reap() pid = %d status = %d activechildren=%d\n", - pid, status, activechildren); + "reap() pid = %ld status = %d activechildren=%d\n", + (long)pid, status, activechildren); /* * See if a child really exited @@ -444,8 +446,8 @@ if (pc->c_name && kill(pc->c_pid, 0) < 0 && errno == ESRCH) { debugmsg(DM_MISC, - "waitup() proc %d (%s) died unexpectedly!", - pc->c_pid, pc->c_name); + "waitup() proc %ld (%s) died unexpectedly!", + (long)pc->c_pid, pc->c_name); pc->c_state = PSdead; needscan = TRUE; }