summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/fstat/fstat.c48
-rw-r--r--usr.bin/fstat/isofs.c5
-rw-r--r--usr.bin/ipcs/ipcs.c4
-rw-r--r--usr.bin/kdump/kdump.c7
-rw-r--r--usr.bin/learn/src/learn.c10
-rw-r--r--usr.bin/leave/leave.c10
-rw-r--r--usr.bin/mail/popen.c6
-rw-r--r--usr.bin/make/compat.c6
-rw-r--r--usr.bin/make/job.c38
-rw-r--r--usr.bin/newsyslog/newsyslog.c10
-rw-r--r--usr.bin/oldrdist/docmd.c6
-rw-r--r--usr.bin/oldrdist/main.c8
-rw-r--r--usr.bin/oldrdist/server.c15
-rw-r--r--usr.bin/passwd/krb_passwd.c4
-rw-r--r--usr.bin/rdist/child.c58
-rw-r--r--usr.bin/rdist/common.c13
-rw-r--r--usr.bin/rdist/docmd.c6
-rw-r--r--usr.bin/rpcgen/rpc_svcout.c8
-rw-r--r--usr.bin/rsh/kcmd.c7
-rw-r--r--usr.bin/rsh/rsh.c10
-rw-r--r--usr.bin/sudo/logging.c3
-rw-r--r--usr.bin/sup/src/run.c6
-rw-r--r--usr.bin/sup/src/scm.c8
-rw-r--r--usr.bin/sup/src/supcmain.c4
-rw-r--r--usr.bin/sup/src/supcmeat.c30
-rw-r--r--usr.bin/sup/src/supfilesrv.c11
-rw-r--r--usr.bin/sup/src/supmsg.c4
-rw-r--r--usr.bin/sup/src/supmsg.h4
-rw-r--r--usr.bin/telnet/commands.c6
-rw-r--r--usr.bin/telnet/sys_bsd.c4
-rw-r--r--usr.bin/tip/aculib/dn11.c6
-rw-r--r--usr.bin/tip/aculib/v831.c9
-rw-r--r--usr.bin/tip/cmds.c19
-rw-r--r--usr.bin/tip/uucplock.c8
-rw-r--r--usr.bin/tn3270/sys_curses/system.c8
-rw-r--r--usr.bin/top/display.c12
-rw-r--r--usr.bin/top/machine.h4
-rw-r--r--usr.bin/vi/common/main.c6
-rw-r--r--usr.bin/vi/common/msg.c4
-rw-r--r--usr.bin/vi/ex/ex_argv.c4
-rw-r--r--usr.bin/vi/ex/ex_cscope.c4
-rw-r--r--usr.bin/vi/ex/ex_filter.c6
-rw-r--r--usr.bin/vi/ex/ex_script.c4
-rw-r--r--usr.bin/vi/ex/ex_shell.c10
-rw-r--r--usr.bin/vi/include/ex_extern.h4
-rw-r--r--usr.bin/window/ww.h4
-rw-r--r--usr.bin/window/wwchild.c6
-rw-r--r--usr.bin/window/wwenviron.c6
-rw-r--r--usr.bin/window/wwspawn.c8
-rw-r--r--usr.bin/xlint/xlint/xlint.c7
50 files changed, 266 insertions, 232 deletions
diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c
index a399c2d497d..1bfd1d68d03 100644
--- a/usr.bin/fstat/fstat.c
+++ b/usr.bin/fstat/fstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fstat.c,v 1.38 2002/05/19 22:01:15 deraadt Exp $ */
+/* $OpenBSD: fstat.c,v 1.39 2002/06/12 06:07:15 mpech Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -41,7 +41,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)fstat.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$OpenBSD: fstat.c,v 1.38 2002/05/19 22:01:15 deraadt Exp $";
+static char *rcsid = "$OpenBSD: fstat.c,v 1.39 2002/06/12 06:07:15 mpech Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -287,7 +287,7 @@ char *Uname, *Comm;
pid_t Pid;
#define PREFIX(i) do { \
- printf("%-8.8s %-10s %5d", Uname, Comm, Pid); \
+ printf("%-8.8s %-10s %5ld", Uname, Comm, (long)Pid); \
switch(i) { \
case TEXT: \
printf(" text"); \
@@ -329,12 +329,14 @@ dofiles(kp)
if (p->p_fd == NULL)
return;
if (!KVM_READ(p->p_fd, &filed0, sizeof (filed0))) {
- dprintf("can't read filedesc at %p for pid %d", p->p_fd, Pid);
+ dprintf("can't read filedesc at %p for pid %ld",
+ p->p_fd, (long)Pid);
return;
}
if (filed.fd_nfiles < 0 || filed.fd_lastfile >= filed.fd_nfiles ||
filed.fd_freefile > filed.fd_lastfile + 1) {
- dprintf("filedesc corrupted at %p for pid %d", p->p_fd, Pid);
+ dprintf("filedesc corrupted at %p for pid %ld",
+ p->p_fd, (long)Pid);
return;
}
/*
@@ -359,8 +361,8 @@ dofiles(kp)
if (filed.fd_nfiles > NDFILE) {
if (!KVM_READ(filed.fd_ofiles, ofiles,
(filed.fd_lastfile+1) * FPSIZE)) {
- dprintf("can't read file structures at %p for pid %d",
- filed.fd_ofiles, Pid);
+ dprintf("can't read file structures at %p for pid %ld",
+ filed.fd_ofiles, (long)Pid);
return;
}
} else
@@ -369,8 +371,8 @@ dofiles(kp)
if (ofiles[i] == NULL)
continue;
if (!KVM_READ(ofiles[i], &file, sizeof (struct file))) {
- dprintf("can't read file %d at %p for pid %d",
- i, ofiles[i], Pid);
+ dprintf("can't read file %d at %p for pid %ld",
+ i, ofiles[i], (long)Pid);
continue;
}
if (file.f_type == DTYPE_VNODE)
@@ -392,8 +394,8 @@ dofiles(kp)
if (checkfile == 0)
systracetrans((struct fsystrace *)file.f_data, i);
} else {
- dprintf("unknown file type %d for file %d of pid %d",
- file.f_type, i, Pid);
+ dprintf("unknown file type %d for file %d of pid %ld",
+ file.f_type, i, (long)Pid);
}
}
}
@@ -412,7 +414,7 @@ vtrans(vp, i, flag, offset)
filename = badtype = NULL;
if (!KVM_READ(vp, &vn, sizeof (struct vnode))) {
- dprintf("can't read vnode at %p for pid %d", vp, Pid);
+ dprintf("can't read vnode at %p for pid %ld", vp, (long)Pid);
return;
}
if (vn.v_type == VNON || vn.v_tag == VT_NON)
@@ -527,7 +529,8 @@ ufs_filestat(vp, fsp)
struct inode inode;
if (!KVM_READ(VTOI(vp), &inode, sizeof (inode))) {
- dprintf("can't read inode at %p for pid %d", VTOI(vp), Pid);
+ dprintf("can't read inode at %p for pid %ld",
+ VTOI(vp), (long)Pid);
return 0;
}
fsp->fsid = inode.i_dev & 0xffff;
@@ -547,7 +550,8 @@ ext2fs_filestat(vp, fsp)
struct inode inode;
if (!KVM_READ(VTOI(vp), &inode, sizeof (inode))) {
- dprintf("can't read inode at %p for pid %d", VTOI(vp), Pid);
+ dprintf("can't read inode at %p for pid %ld",
+ VTOI(vp), (long)Pid);
return 0;
}
fsp->fsid = inode.i_dev & 0xffff;
@@ -568,7 +572,8 @@ msdos_filestat(vp, fsp)
struct inode inode;
if (!KVM_READ(VTOI(vp), &inode, sizeof (inode))) {
- dprintf("can't read inode at %p for pid %d", VTOI(vp), Pid);
+ dprintf("can't read inode at %p for pid %ld",
+ VTOI(vp), (long)Pid);
return 0;
}
fsp->fsid = inode.i_dev & 0xffff;
@@ -590,7 +595,8 @@ nfs_filestat(vp, fsp)
mode_t mode;
if (!KVM_READ(VTONFS(vp), &nfsnode, sizeof (nfsnode))) {
- dprintf("can't read nfsnode at %p for pid %d", VTONFS(vp), Pid);
+ dprintf("can't read nfsnode at %p for pid %ld",
+ VTONFS(vp), (long)Pid);
return 0;
}
fsp->fsid = nfsnode.n_vattr.va_fsid;
@@ -636,7 +642,8 @@ xfs_filestat(vp, fsp)
struct xfs_node xfs_node;
if (!KVM_READ(VNODE_TO_XNODE(vp), &xfs_node, sizeof (xfs_node))) {
- dprintf("can't read xfs_node at %p for pid %d", VTOI(vp), Pid);
+ dprintf("can't read xfs_node at %p for pid %ld",
+ VTOI(vp), (long)Pid);
return 0;
}
fsp->fsid = xfs_node.attr.va_fsid;
@@ -661,7 +668,8 @@ null_filestat(vp, fsp)
memset(&fst, 0, sizeof fst);
if (!KVM_READ(VTONULL(vp), &node, sizeof (node))) {
- dprintf("can't read node at %p for pid %d", VTONULL(vp), Pid);
+ dprintf("can't read node at %p for pid %ld",
+ VTONULL(vp), (long)Pid);
return 0;
}
@@ -670,8 +678,8 @@ null_filestat(vp, fsp)
*/
if (node.null_lowervp) {
if (!KVM_READ(node.null_lowervp, &vn, sizeof (vn))) {
- dprintf("can't read vnode at %p for pid %d",
- node.null_lowervp, Pid);
+ dprintf("can't read vnode at %p for pid %ld",
+ node.null_lowervp, (long)Pid);
return 0;
}
diff --git a/usr.bin/fstat/isofs.c b/usr.bin/fstat/isofs.c
index 67566353d0b..2035c7065f6 100644
--- a/usr.bin/fstat/isofs.c
+++ b/usr.bin/fstat/isofs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isofs.c,v 1.3 2001/12/01 18:59:59 deraadt Exp $ */
+/* $OpenBSD: isofs.c,v 1.4 2002/06/12 06:07:15 mpech Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -85,7 +85,8 @@ isofs_filestat(vp, fsp)
struct iso_node inode;
if (!KVM_READ(VTOI(vp), &inode, sizeof (inode))) {
- dprintf("can't read inode at %p for pid %d", VTOI(vp), Pid);
+ dprintf("can't read inode at %p for pid %ld",
+ VTOI(vp), (long)Pid);
return 0;
}
fsp->fsid = inode.i_dev & 0xffff;
diff --git a/usr.bin/ipcs/ipcs.c b/usr.bin/ipcs/ipcs.c
index 8e1ab1246af..1e727dffbab 100644
--- a/usr.bin/ipcs/ipcs.c
+++ b/usr.bin/ipcs/ipcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipcs.c,v 1.16 2001/09/28 01:44:37 millert Exp $ */
+/* $OpenBSD: ipcs.c,v 1.17 2002/06/12 06:07:15 mpech Exp $ */
/* $NetBSD: ipcs.c,v 1.25 2000/06/16 03:58:20 simonb Exp $ */
/*-
@@ -338,7 +338,7 @@ show_msginfo(time_t stime, time_t rtime, time_t ctime, int ipcid, key_t key,
printf(" %6lu", qbytes);
if (option & PID)
- printf(" %5d %5d", lspid, lrpid);
+ printf(" %5ld %5ld", (long)lspid, (long)lrpid);
if (option & TIME)
printf(" %s %s %s", stime_buf, rtime_buf, ctime_buf);
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index df550e0a810..389d34323a5 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kdump.c,v 1.15 2002/03/12 10:40:33 art Exp $ */
+/* $OpenBSD: kdump.c,v 1.16 2002/06/12 06:07:15 mpech Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#endif
-static char *rcsid = "$OpenBSD: kdump.c,v 1.15 2002/03/12 10:40:33 art Exp $";
+static char *rcsid = "$OpenBSD: kdump.c,v 1.16 2002/06/12 06:07:15 mpech Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -303,7 +303,8 @@ dumpheader(kth)
type = unknown;
}
- (void)printf("%6d %-8.*s ", kth->ktr_pid, MAXCOMLEN, kth->ktr_comm);
+ (void)printf("%6ld %-8.*s ", (long)kth->ktr_pid, MAXCOMLEN,
+ kth->ktr_comm);
if (timestamp) {
if (timestamp == 2) {
timersub(&kth->ktr_time, &prevtime, &temp);
diff --git a/usr.bin/learn/src/learn.c b/usr.bin/learn/src/learn.c
index 42227bdcc31..56ce44b4fca 100644
--- a/usr.bin/learn/src/learn.c
+++ b/usr.bin/learn/src/learn.c
@@ -2,7 +2,7 @@
* learn, from V7 UNIX: one of the earliest Computer Based Training (CBT)
* programs still in existence.
*
- * $OpenBSD: learn.c,v 1.7 2001/11/19 19:02:14 mpech Exp $
+ * $OpenBSD: learn.c,v 1.8 2002/06/12 06:07:15 mpech Exp $
*/
/****************************************************************
@@ -691,7 +691,8 @@ char *s;
int system(const char *s)
{
- int status, pid, w;
+ int status;
+ pid_t pid, w;
void (*istat)(int), (*qstat)(int);
istat = signal(SIGINT, SIG_IGN); /* XXX should use sigaction() */
@@ -1025,7 +1026,8 @@ int n;
{
/* this routine does not use 'system' because it wants
interrupts turned off */
- int retval, pid, pidw;
+ int retval;
+ pid_t pid;
signal(SIGINT, SIG_IGN);
chdir("..");
@@ -1039,6 +1041,6 @@ int n;
printf("Bye.\n"); /* not only does this reassure user but
it stalls for time while deleting directory */
fflush(stdout);
- /* printf("Wantd %d got %d val %d\n",pid, pidw, retval); */
+ /* printf("Wantd %ld got %ld val %d\n", (long)pid, (long)pidw, retval); */
exit(n);
}
diff --git a/usr.bin/leave/leave.c b/usr.bin/leave/leave.c
index 74d41b6fa13..43b07628d15 100644
--- a/usr.bin/leave/leave.c
+++ b/usr.bin/leave/leave.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: leave.c,v 1.7 2002/02/16 21:27:47 millert Exp $ */
+/* $OpenBSD: leave.c,v 1.8 2002/06/12 06:07:15 mpech Exp $ */
/* $NetBSD: leave.c,v 1.4 1995/07/03 16:50:13 phil Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)leave.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: leave.c,v 1.7 2002/02/16 21:27:47 millert Exp $";
+static char rcsid[] = "$OpenBSD: leave.c,v 1.8 2002/06/12 06:07:15 mpech Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -134,13 +134,13 @@ doalarm(secs)
{
int bother;
time_t daytime;
- int pid;
+ pid_t pid;
if ((pid = fork())) {
(void)time(&daytime);
daytime += secs;
- printf("Alarm set for %.16s. (pid %d)\n",
- ctime(&daytime), pid);
+ printf("Alarm set for %.16s. (pid %ld)\n",
+ ctime(&daytime), (long)pid);
exit(0);
}
sleep((u_int)2); /* let parent print set message */
diff --git a/usr.bin/mail/popen.c b/usr.bin/mail/popen.c
index 7932f1e9180..206cdbf774b 100644
--- a/usr.bin/mail/popen.c
+++ b/usr.bin/mail/popen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popen.c,v 1.31 2001/11/23 00:03:24 millert Exp $ */
+/* $OpenBSD: popen.c,v 1.32 2002/06/12 06:07:15 mpech Exp $ */
/* $NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static const char sccsid[] = "@(#)popen.c 8.1 (Berkeley) 6/6/93";
#else
-static const char rcsid[] = "$OpenBSD: popen.c,v 1.31 2001/11/23 00:03:24 millert Exp $";
+static const char rcsid[] = "$OpenBSD: popen.c,v 1.32 2002/06/12 06:07:15 mpech Exp $";
#endif
#endif /* not lint */
@@ -381,7 +381,7 @@ wait_child(pid_t pid)
{
struct child *cp;
sigset_t nset, oset;
- int rv = 0;
+ pid_t rv = 0;
sigemptyset(&nset);
sigaddset(&nset, SIGCHLD);
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index 8edf215e7c7..922762638ba 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: compat.c,v 1.46 2002/01/16 01:28:54 millert Exp $ */
+/* $OpenBSD: compat.c,v 1.47 2002/06/12 06:07:15 mpech Exp $ */
/* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */
/*
@@ -171,8 +171,8 @@ CompatRunCommand(cmdp, gnp)
volatile bool errCheck; /* Check errors */
int reason; /* Reason for child's death */
int status; /* Description of child's death */
- int cpid; /* Child actually found */
- int stat; /* Status of fork */
+ pid_t cpid; /* Child actually found */
+ pid_t stat; /* Status of fork */
LstNode cmdNode; /* Node where current command is located */
char ** volatile av; /* Argument vector for thing to exec */
int argc; /* Number of arguments in av or 0 if not
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index 184d417c188..17116189f45 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: job.c,v 1.50 2002/03/19 00:08:31 espie Exp $ */
+/* $OpenBSD: job.c,v 1.51 2002/06/12 06:07:16 mpech Exp $ */
/* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */
/*
@@ -173,7 +173,7 @@
*/
#define JOB_BUFSIZE 1024
typedef struct Job_ {
- int pid; /* The child's process ID */
+ pid_t pid; /* The child's process ID */
GNode *node; /* The target the child is making */
LstNode tailCmds; /* The node of the first command to be
* saved when the job has been run */
@@ -469,8 +469,8 @@ JobCondPassSig(jobp, signop)
int signo = *(int *)signop;
if (DEBUG(JOB)) {
(void)fprintf(stdout,
- "JobCondPassSig passing signal %d to child %d.\n",
- signo, job->pid);
+ "JobCondPassSig passing signal %d to child %ld.\n",
+ signo, (long)job->pid);
(void)fflush(stdout);
}
KILL(job->pid, signo);
@@ -569,7 +569,7 @@ JobCmpPid(job, pid)
void *job; /* job to examine */
void *pid; /* process id desired */
{
- return *(int *)pid - ((Job *)job)->pid;
+ return *(pid_t *)pid - ((Job *)job)->pid;
}
/*-
@@ -880,7 +880,7 @@ JobFinish(job, status)
if (WIFEXITED(*status)) {
if (DEBUG(JOB)) {
- (void)fprintf(stdout, "Process %d exited.\n", job->pid);
+ (void)fprintf(stdout, "Process %ld exited.\n", (long)job->pid);
(void)fflush(stdout);
}
if (WEXITSTATUS(*status) != 0) {
@@ -904,7 +904,7 @@ JobFinish(job, status)
}
} else if (WIFSTOPPED(*status)) {
if (DEBUG(JOB)) {
- (void)fprintf(stdout, "Process %d stopped.\n", job->pid);
+ (void)fprintf(stdout, "Process %ld stopped.\n", (long)job->pid);
(void)fflush(stdout);
}
if (usePipes && job->node != lastNode) {
@@ -933,8 +933,8 @@ JobFinish(job, status)
if (!(job->flags & JOB_CONTINUING)) {
if (DEBUG(JOB)) {
(void)fprintf(stdout,
- "Warning: process %d was not continuing.\n",
- job->pid);
+ "Warning: process %ld was not continuing.\n",
+ (long)job->pid);
(void)fflush(stdout);
}
#ifdef notdef
@@ -952,8 +952,8 @@ JobFinish(job, status)
nJobs += 1;
if (DEBUG(JOB)) {
(void)fprintf(stdout,
- "Process %d is continuing locally.\n",
- job->pid);
+ "Process %ld is continuing locally.\n",
+ (long)job->pid);
(void)fflush(stdout);
}
nLocal += 1;
@@ -1193,7 +1193,7 @@ JobExec(job, argv)
Job *job; /* Job to execute */
char **argv;
{
- int cpid; /* ID of new child */
+ pid_t cpid; /* ID of new child */
if (DEBUG(JOB)) {
int i;
@@ -2045,7 +2045,7 @@ void
Job_CatchChildren(block)
bool block; /* true if should block on the wait. */
{
- int pid; /* pid of dead child */
+ pid_t pid; /* pid of dead child */
Job *job; /* job descriptor for dead child */
LstNode jnode; /* list element for finding job */
int status; /* Exit/termination status */
@@ -2061,7 +2061,7 @@ Job_CatchChildren(block)
(block?0:WNOHANG)|WUNTRACED)) > 0)
{
if (DEBUG(JOB)) {
- (void)fprintf(stdout, "Process %d exited or stopped.\n", pid);
+ (void)fprintf(stdout, "Process %ld exited or stopped.\n", (long)pid);
(void)fflush(stdout);
}
@@ -2072,13 +2072,13 @@ Job_CatchChildren(block)
if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) {
jnode = Lst_Find(&stoppedJobs, JobCmpPid, &pid);
if (jnode == NULL) {
- Error("Resumed child (%d) not in table", pid);
+ Error("Resumed child (%ld) not in table", (long)pid);
continue;
}
job = (Job *)Lst_Datum(jnode);
Lst_Remove(&stoppedJobs, jnode);
} else {
- Error("Child (%d) not in table?", pid);
+ Error("Child (%ld) not in table?", (long)pid);
continue;
}
} else {
@@ -2570,8 +2570,8 @@ JobInterrupt(runINTERRUPT, signo)
if (job->pid) {
if (DEBUG(JOB)) {
(void)fprintf(stdout,
- "JobInterrupt passing signal to child %d.\n",
- job->pid);
+ "JobInterrupt passing signal to child %ld.\n",
+ (long)job->pid);
(void)fflush(stdout);
}
KILL(job->pid, signo);
@@ -2702,7 +2702,7 @@ Job_AbortAll()
/*
* Catch as many children as want to report in at first, then give up
*/
- while (waitpid((pid_t) -1, &foo, WNOHANG) > 0)
+ while (waitpid(-1, &foo, WNOHANG) > 0)
continue;
(void)eunlink(tfile);
}
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
index a11cfd62a27..e6bec0c2f2a 100644
--- a/usr.bin/newsyslog/newsyslog.c
+++ b/usr.bin/newsyslog/newsyslog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newsyslog.c,v 1.43 2002/02/16 21:27:50 millert Exp $ */
+/* $OpenBSD: newsyslog.c,v 1.44 2002/06/12 06:07:16 mpech Exp $ */
/*
* Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -88,7 +88,7 @@ provided "as is" without express or implied warranty.
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.43 2002/02/16 21:27:50 millert Exp $";
+static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.44 2002/06/12 06:07:16 mpech Exp $";
#endif /* not lint */
#ifndef CONF
@@ -354,7 +354,7 @@ send_signal(pidfile, signal)
if (err)
warnx("%s pid file: %s", err, pidfile);
else if (noaction)
- (void)printf("kill -%s %u\n", sys_signame[signal], pid);
+ (void)printf("kill -%s %ld\n", sys_signame[signal], (long)pid);
else if (kill(pid, signal))
warnx("warning - could not send SIG%s to daemon",
sys_signame[signal]);
@@ -715,8 +715,8 @@ log_trim(log)
if ((f = fopen(log, "a")) == NULL)
return(-1);
- (void)fprintf(f, "%s %s newsyslog[%u]: logfile turned over\n",
- daytime, hostname, getpid());
+ (void)fprintf(f, "%s %s newsyslog[%ld]: logfile turned over\n",
+ daytime, hostname, (long)getpid());
if (fclose(f) == EOF)
err(1, "log_trim: fclose");
return(0);
diff --git a/usr.bin/oldrdist/docmd.c b/usr.bin/oldrdist/docmd.c
index 0816e91260c..8bb3cff3461 100644
--- a/usr.bin/oldrdist/docmd.c
+++ b/usr.bin/oldrdist/docmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: docmd.c,v 1.16 2002/02/17 19:42:31 millert Exp $ */
+/* $OpenBSD: docmd.c,v 1.17 2002/06/12 06:07:16 mpech Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,7 +35,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)docmd.c 8.1 (Berkeley) 6/9/93"; */
-static char *rcsid = "$OpenBSD: docmd.c,v 1.16 2002/02/17 19:42:31 millert Exp $";
+static char *rcsid = "$OpenBSD: docmd.c,v 1.17 2002/06/12 06:07:16 mpech Exp $";
#endif /* not lint */
#include "defs.h"
@@ -220,7 +220,7 @@ makeconn(rhost)
int n;
extern char user[];
#if defined(DIRECT_RCMD)
- extern int userid;
+ extern uid_t userid;
#endif
if (debug)
diff --git a/usr.bin/oldrdist/main.c b/usr.bin/oldrdist/main.c
index 21eb70f0b52..f3191e523d0 100644
--- a/usr.bin/oldrdist/main.c
+++ b/usr.bin/oldrdist/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.13 2002/06/09 21:11:22 hin Exp $ */
+/* $OpenBSD: main.c,v 1.14 2002/06/12 06:07:16 mpech Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -41,7 +41,7 @@ static char copyright[] =
#ifndef lint
/* from: static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/9/93"; */
-static char *rcsid = "$OpenBSD: main.c,v 1.13 2002/06/09 21:11:22 hin Exp $";
+static char *rcsid = "$OpenBSD: main.c,v 1.14 2002/06/12 06:07:16 mpech Exp $";
#endif /* not lint */
#include <stdarg.h>
@@ -70,8 +70,8 @@ char host[32]; /* host name */
int nerrs; /* number of errors while sending/receiving */
char user[10]; /* user's name */
char homedir[128]; /* user's home directory */
-int userid; /* user's user ID */
-int groupid; /* user's group ID */
+uid_t userid; /* user's user ID */
+gid_t groupid; /* user's group ID */
struct passwd *pw; /* pointer to static area used by getpwent */
struct group *gr; /* pointer to static area used by getgrent */
diff --git a/usr.bin/oldrdist/server.c b/usr.bin/oldrdist/server.c
index 04173e34edc..973fea3ab71 100644
--- a/usr.bin/oldrdist/server.c
+++ b/usr.bin/oldrdist/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.18 2002/06/09 21:11:22 hin Exp $ */
+/* $OpenBSD: server.c,v 1.19 2002/06/12 06:07:16 mpech Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,7 +35,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)server.c 8.1 (Berkeley) 6/9/93"; */
-static char *rcsid = "$OpenBSD: server.c,v 1.18 2002/06/09 21:11:22 hin Exp $";
+static char *rcsid = "$OpenBSD: server.c,v 1.19 2002/06/12 06:07:16 mpech Exp $";
#endif /* not lint */
#include <sys/wait.h>
@@ -1081,9 +1081,10 @@ fchog(fd, file, owner, group, mode)
int mode;
{
int i;
- int uid, gid;
+ uid_t uid;
+ gid_t gid;
extern char user[];
- extern int userid;
+ extern uid_t userid;
uid = userid;
if (userid == 0) {
@@ -1368,10 +1369,12 @@ static void
dospecial(cmd)
char *cmd;
{
- int fd[2], status, pid, i;
+ int fd[2], status;
char *cp, *s;
char sbuf[BUFSIZ];
- extern int userid, groupid;
+ pid_t pid, i;
+ extern uid_t userid;
+ extern gid_t groupid;
if (pipe(fd) < 0) {
error("%s\n", strerror(errno));
diff --git a/usr.bin/passwd/krb_passwd.c b/usr.bin/passwd/krb_passwd.c
index 1a6500efae0..ac97717c746 100644
--- a/usr.bin/passwd/krb_passwd.c
+++ b/usr.bin/passwd/krb_passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: krb_passwd.c,v 1.14 2002/05/10 06:52:03 hugh Exp $ */
+/* $OpenBSD: krb_passwd.c,v 1.15 2002/06/12 06:07:16 mpech Exp $ */
/* $KTH: kpasswd.c,v 1.25 1997/05/02 14:28:51 assar Exp $ */
/*
@@ -160,7 +160,7 @@ krb_passwd(int argc, char **argv)
}
snprintf(tktstring, sizeof(tktstring),
- "%s_cpw_%u", TKT_ROOT, (unsigned)getpid());
+ "%s_cpw_%ld", TKT_ROOT, (long)getpid());
krb_set_tkt_string(tktstring);
if (get_pw_new_pwd(pword, sizeof(pword), &principal,
diff --git a/usr.bin/rdist/child.c b/usr.bin/rdist/child.c
index b790c8402ce..297fc165770 100644
--- a/usr.bin/rdist/child.c
+++ b/usr.bin/rdist/child.c
@@ -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 @@ static char RCSid[] =
"$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 @@ static void removechild(child)
{
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 @@ static void removechild(child)
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 @@ static void addchild(child)
++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 @@ static void readchild(child)
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 @@ static void readchild(child)
*/
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 @@ static void readchild(child)
* 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 @@ static int waitproc(statval, block)
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 @@ static void reap()
*/
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 @@ extern void waitup()
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;
}
diff --git a/usr.bin/rdist/common.c b/usr.bin/rdist/common.c
index f06e5735557..beafd3b257f 100644
--- a/usr.bin/rdist/common.c
+++ b/usr.bin/rdist/common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: common.c,v 1.14 2002/05/27 03:14:22 deraadt Exp $ */
+/* $OpenBSD: common.c,v 1.15 2002/06/12 06:07:16 mpech Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -39,7 +39,7 @@ static char RCSid[] =
"$From: common.c,v 6.82 1998/03/23 23:27:33 michaelc Exp $";
#else
static char RCSid[] =
-"$OpenBSD: common.c,v 1.14 2002/05/27 03:14:22 deraadt Exp $";
+"$OpenBSD: common.c,v 1.15 2002/06/12 06:07:16 mpech Exp $";
#endif
static char sccsid[] = "@(#)common.c";
@@ -238,8 +238,8 @@ extern void lostconn()
*/
extern void coredump()
{
- error("Segmentation violation - dumping core [PID = %d, %s]",
- getpid(),
+ error("Segmentation violation - dumping core [PID = %ld, %s]",
+ (long)getpid(),
(isserver) ? "isserver" : ((amchild) ? "amchild" : "parent"));
abort();
/*NOTREACHED*/
@@ -820,11 +820,12 @@ extern char *getversion()
void runcommand(cmd)
char *cmd;
{
- int fd[2], pid, i;
+ int fd[2];
int status;
char *cp, *s;
char sbuf[BUFSIZ], buf[BUFSIZ];
-
+ pid_t pid, i;
+
if (pipe(fd) < 0) {
error("pipe of %s failed: %s", cmd, SYSERR);
return;
diff --git a/usr.bin/rdist/docmd.c b/usr.bin/rdist/docmd.c
index 5bea1130fa1..f9f470e1ee2 100644
--- a/usr.bin/rdist/docmd.c
+++ b/usr.bin/rdist/docmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: docmd.c,v 1.10 2001/11/19 19:02:15 mpech Exp $ */
+/* $OpenBSD: docmd.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 @@ static char RCSid[] =
"$From: docmd.c,v 6.86 1996/01/30 02:29:43 mcooper Exp $";
#else
static char RCSid[] =
-"$OpenBSD: docmd.c,v 1.10 2001/11/19 19:02:15 mpech Exp $";
+"$OpenBSD: docmd.c,v 1.11 2002/06/12 06:07:16 mpech Exp $";
#endif
static char sccsid[] = "@(#)docmd.c 5.1 (Berkeley) 6/6/85";
@@ -870,7 +870,7 @@ static void docmdhost(cmd, filev)
* new child process.
*/
if (do_fork && !amchild) {
- int pid;
+ pid_t pid;
/*
* If we're at maxchildren, wait for number of active
diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c
index 81f83a4fc55..1760fadf00e 100644
--- a/usr.bin/rpcgen/rpc_svcout.c
+++ b/usr.bin/rpcgen/rpc_svcout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rpc_svcout.c,v 1.13 2002/06/09 01:28:06 deraadt Exp $ */
+/* $OpenBSD: rpc_svcout.c,v 1.14 2002/06/12 06:07:16 mpech Exp $ */
/* $NetBSD: rpc_svcout.c,v 1.7 1995/06/24 14:59:59 pk Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -793,8 +793,10 @@ write_rpc_svc_fg(infile, sp)
fprintf(fout, "%sint size;\n", sp);
if (tirpcflag)
fprintf(fout, "%sstruct rlimit rl;\n", sp);
- if (inetdflag)
- fprintf(fout, "%sint pid, i;\n\n", sp);
+ if (inetdflag) {
+ fprintf(fout, "%sint i;\n\n", sp);
+ fprintf(fout, "%spid_t pid;\n\n", sp);
+ }
fprintf(fout, "%spid = fork();\n", sp);
fprintf(fout, "%sif (pid < 0) {\n", sp);
fprintf(fout, "%s\tperror(\"cannot fork\");\n", sp);
diff --git a/usr.bin/rsh/kcmd.c b/usr.bin/rsh/kcmd.c
index 91468207f1b..954b0fc800b 100644
--- a/usr.bin/rsh/kcmd.c
+++ b/usr.bin/rsh/kcmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kcmd.c,v 1.2 2002/06/02 19:06:39 deraadt Exp $ */
+/* $OpenBSD: kcmd.c,v 1.3 2002/06/12 06:07:16 mpech Exp $ */
/* $NetBSD: kcmd.c,v 1.2 1995/03/21 07:58:32 cgd Exp $ */
/*
@@ -39,7 +39,7 @@
static char Xsccsid[] = "derived from @(#)rcmd.c 5.17 (Berkeley) 6/27/88";
static char sccsid[] = "@(#)kcmd.c 8.2 (Berkeley) 8/19/93";
#else
-static char rcsid[] = "$OpenBSD: kcmd.c,v 1.2 2002/06/02 19:06:39 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: kcmd.c,v 1.3 2002/06/12 06:07:16 mpech Exp $";
#endif
#endif /* not lint */
@@ -95,7 +95,7 @@ kcmd(sock, ahost, rport, locuser, remuser, cmd, fd2p, ticket, service, realm,
struct sockaddr_in *laddr, *faddr;
long authopts;
{
- int s, timo = 1, pid;
+ int s, timo = 1;
sigset_t mask, oldmask;
struct sockaddr_in sin, from;
char c;
@@ -104,6 +104,7 @@ kcmd(sock, ahost, rport, locuser, remuser, cmd, fd2p, ticket, service, realm,
int rc;
char *host_save;
int status;
+ pid_t pid;
pid = getpid();
hp = gethostbyname(*ahost);
diff --git a/usr.bin/rsh/rsh.c b/usr.bin/rsh/rsh.c
index 1e7c54a69f2..2489bb27d41 100644
--- a/usr.bin/rsh/rsh.c
+++ b/usr.bin/rsh/rsh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsh.c,v 1.27 2002/06/09 05:50:33 hin Exp $ */
+/* $OpenBSD: rsh.c,v 1.28 2002/06/12 06:07:16 mpech Exp $ */
/*-
* Copyright (c) 1983, 1990 The Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)rsh.c 5.24 (Berkeley) 7/1/91";*/
-static char rcsid[] = "$OpenBSD: rsh.c,v 1.27 2002/06/09 05:50:33 hin Exp $";
+static char rcsid[] = "$OpenBSD: rsh.c,v 1.28 2002/06/12 06:07:16 mpech Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -100,9 +100,10 @@ main(argc, argv)
struct passwd *pw;
struct servent *sp;
sigset_t mask, omask;
- int argoff, asrsh, ch, dflag, nflag, one, pid = 0, rem, uid;
+ int argoff, asrsh, ch, dflag, nflag, one, rem, uid;
char *p;
char *args, *host, *user, *copyargs();
+ pid_t pid = 0;
void sendsig();
argoff = asrsh = dflag = nflag = 0;
@@ -332,8 +333,9 @@ try_connect:
void
talk(nflag, omask, pid, rem)
- int nflag, pid;
+ int nflag;
sigset_t *omask;
+ pid_t pid;
int rem;
{
int cc, wc;
diff --git a/usr.bin/sudo/logging.c b/usr.bin/sudo/logging.c
index 723d19e99fc..6e91107a902 100644
--- a/usr.bin/sudo/logging.c
+++ b/usr.bin/sudo/logging.c
@@ -437,7 +437,8 @@ send_mail(line)
{
FILE *mail;
char *p;
- int pfd[2], pid, status;
+ int pfd[2], status;
+ pid_t pid;
sigset_t set, oset;
#ifndef NO_ROOT_MAILER
static char *root_envp[] = {
diff --git a/usr.bin/sup/src/run.c b/usr.bin/sup/src/run.c
index 229f7555c20..b49a4bdc668 100644
--- a/usr.bin/sup/src/run.c
+++ b/usr.bin/sup/src/run.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: run.c,v 1.12 2002/02/19 19:39:39 millert Exp $ */
+/* $OpenBSD: run.c,v 1.13 2002/06/12 06:07:16 mpech Exp $ */
/*
* Copyright (c) 1991 Carnegie Mellon University
@@ -166,8 +166,8 @@ dorun(name, argv, usepath)
char *name,**argv;
int usepath;
{
- int wpid;
- int pid;
+ pid_t wpid;
+ pid_t pid;
struct sigaction ignoresig, intsig, quitsig;
int status;
diff --git a/usr.bin/sup/src/scm.c b/usr.bin/sup/src/scm.c
index f9c874cf344..16b98a3bba6 100644
--- a/usr.bin/sup/src/scm.c
+++ b/usr.bin/sup/src/scm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scm.c,v 1.15 2002/02/19 19:39:39 millert Exp $ */
+/* $OpenBSD: scm.c,v 1.16 2002/06/12 06:07:16 mpech Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -203,7 +203,7 @@ extern int silent;
*********************************************/
extern char program[]; /* name of program we are running */
-extern int progpid; /* process id to display */
+extern pid_t progpid; /* process id to display */
int netfile = -1; /* network file descriptor */
@@ -292,7 +292,7 @@ lock_host_file(lockdir)
close(fd);
return(-1);
}
- (void)fprintf(f, "%d\n", (int) getpid());
+ (void)fprintf(f, "%ld\n", (long) getpid());
fflush(f);
free(lpath);
return(fd);
@@ -630,7 +630,7 @@ int scmerr(int error,char *fmt,...)
va_start(ap,fmt);
(void) fflush(stdout);
if (progpid > 0)
- fprintf(stderr, "%s %d: ", program, progpid);
+ fprintf(stderr, "%s %ld: ", program, (long)progpid);
else
fprintf(stderr,"%s: ", program);
diff --git a/usr.bin/sup/src/supcmain.c b/usr.bin/sup/src/supcmain.c
index 54800d9e29d..1b56ed1417c 100644
--- a/usr.bin/sup/src/supcmain.c
+++ b/usr.bin/sup/src/supcmain.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: supcmain.c,v 1.14 2002/02/19 19:39:39 millert Exp $ */
+/* $OpenBSD: supcmain.c,v 1.15 2002/06/12 06:07:16 mpech Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -329,7 +329,7 @@
*********************************************/
char program[] = "SUP"; /* program name for SCM messages */
-int progpid = -1; /* and process id */
+pid_t progpid = -1; /* and process id */
COLLECTION *firstC, *thisC; /* collection list pointer */
diff --git a/usr.bin/sup/src/supcmeat.c b/usr.bin/sup/src/supcmeat.c
index 0a4442c6481..8b8408acdb0 100644
--- a/usr.bin/sup/src/supcmeat.c
+++ b/usr.bin/sup/src/supcmeat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: supcmeat.c,v 1.16 2002/02/19 19:39:39 millert Exp $ */
+/* $OpenBSD: supcmeat.c,v 1.17 2002/06/12 06:07:16 mpech Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -284,8 +284,8 @@ int signon (t, nhosts, tout)
if (x != SCMOK)
goaway("Error reading signon reply from fileserver");
tloc = time(NULL);
- vnotify("SUP Fileserver %d.%d (%s) %d on %s at %.8s\n", protver,
- pgmver, scmver, fspid, remotehost(), ctime(&tloc) + 11);
+ vnotify("SUP Fileserver %d.%d (%s) %ld on %s at %.8s\n", protver,
+ pgmver, scmver, (long)fspid, remotehost(), ctime(&tloc) + 11);
free(scmver);
scmver = NULL;
if (protver < 4) {
@@ -1156,7 +1156,7 @@ copyfile(to, from)
char dpart[STRINGLENGTH], fpart[STRINGLENGTH];
char tname[STRINGLENGTH];
static int true = 1;
- static int thispid = 0; /* process id # */
+ static pid_t thispid = 0; /* process id # */
if (from) { /* reading file */
fromf = open(from, O_RDONLY, 0);
@@ -1175,15 +1175,16 @@ copyfile(to, from)
for (;;) {
/* try destination directory */
path(to, dpart, fpart, sizeof fpart);
- (void) snprintf(tname, sizeof tname, "%s/#%d.sup",
- dpart, thispid);
+ (void) snprintf(tname, sizeof tname, "%s/#%ld.sup",
+ dpart, (long)thispid);
tof = open(tname, (O_WRONLY|O_CREAT|O_TRUNC), 0600);
if (tof >= 0)
break;
/* try sup directory */
if (thisC->Cprefix)
(void) chdir (thisC->Cbase);
- (void) snprintf(tname, sizeof tname, "sup/#%d.sup", thispid);
+ (void) snprintf(tname, sizeof tname, "sup/#%ld.sup",
+ (long)thispid);
tof = open(tname, (O_WRONLY|O_CREAT|O_TRUNC), 0600);
if (tof >= 0) {
if (thisC->Cprefix)
@@ -1191,7 +1192,8 @@ copyfile(to, from)
break;
}
/* try base directory */
- (void) snprintf(tname, sizeof tname, "#%d.sup", thispid);
+ (void) snprintf(tname, sizeof tname, "#%ld.sup",
+ (long)thispid);
tof = open (tname,(O_WRONLY|O_CREAT|O_TRUNC),0600);
if (thisC->Cprefix)
(void) chdir(thisC->Cprefix);
@@ -1199,22 +1201,22 @@ copyfile(to, from)
break;
#ifdef VAR_TMP
/* try /var/tmp */
- (void) snprintf(tname, sizeof tname, "/var/tmp/#%d.sup",
- thispid);
+ (void) snprintf(tname, sizeof tname, "/var/tmp/#%ld.sup",
+ (long)thispid);
tof = open(tname, (O_WRONLY|O_CREAT|O_TRUNC), 0600);
if (tof >= 0)
break;
#else
/* try /usr/tmp */
- (void) snprintf(tname, sizeof tname, "/usr/tmp/#%d.sup",
- thispid);
+ (void) snprintf(tname, sizeof tname, "/usr/tmp/#%ld.sup",
+ (long)thispid);
tof = open(tname, (O_WRONLY|O_CREAT|O_TRUNC), 0600);
if (tof >= 0)
break;
#endif
/* try /tmp */
- (void) snprintf(tname, sizeof tname, "/tmp/#%d.sup",
- thispid);
+ (void) snprintf(tname, sizeof tname, "/tmp/#%ld.sup",
+ (long)thispid);
tof = open(tname, (O_WRONLY|O_CREAT|O_TRUNC), 0600);
if (tof >= 0)
break;
diff --git a/usr.bin/sup/src/supfilesrv.c b/usr.bin/sup/src/supfilesrv.c
index 5a935914db1..a762ab594c5 100644
--- a/usr.bin/sup/src/supfilesrv.c
+++ b/usr.bin/sup/src/supfilesrv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: supfilesrv.c,v 1.28 2002/02/19 19:39:39 millert Exp $ */
+/* $OpenBSD: supfilesrv.c,v 1.29 2002/06/12 06:07:16 mpech Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -318,7 +318,7 @@ typedef struct hashstruct HASH;
*********************************************/
char program[] = "supfilesrv"; /* program name for SCM messages */
-int progpid = -1; /* and process id */
+pid_t progpid = -1; /* and process id */
jmp_buf sjbuf; /* jump location for network errors */
TREELIST *listTL; /* list of trees to upgrade */
@@ -398,7 +398,8 @@ main (argc,argv)
int argc;
char **argv;
{
- int x,pid;
+ int x;
+ pid_t pid;
sigset_t nset, oset;
struct sigaction chld,ign;
time_t tloc;
@@ -651,8 +652,8 @@ init(argc, argv)
x = msgsignonack();
if (x != SCMOK)
quit(1, "Error reading signon reply from fileserver\n");
- printf("SUP Fileserver %d.%d (%s) %d on %s\n", protver, pgmver,
- scmver, fspid, remotehost());
+ printf("SUP Fileserver %d.%d (%s) %ld on %s\n", protver, pgmver,
+ scmver, (long)fspid, remotehost());
free(scmver);
scmver = NULL;
if (protver < 7)
diff --git a/usr.bin/sup/src/supmsg.c b/usr.bin/sup/src/supmsg.c
index e22ce70571d..bef79abd553 100644
--- a/usr.bin/sup/src/supmsg.c
+++ b/usr.bin/sup/src/supmsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: supmsg.c,v 1.10 2002/02/19 19:39:39 millert Exp $ */
+/* $OpenBSD: supmsg.c,v 1.11 2002/06/12 06:07:16 mpech Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -67,7 +67,7 @@
extern int pgmver; /* program version of partner */
extern int pgmversion; /* my program version */
extern char *scmver; /* scm version of partner */
-extern int fspid; /* process id of fileserver */
+extern pid_t fspid; /* process id of fileserver */
static int refuseone(TREE *, void *);
static int listone(TREE *, void *);
diff --git a/usr.bin/sup/src/supmsg.h b/usr.bin/sup/src/supmsg.h
index 2a58b2430ce..798b42bee50 100644
--- a/usr.bin/sup/src/supmsg.h
+++ b/usr.bin/sup/src/supmsg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: supmsg.h,v 1.6 2001/04/29 21:52:17 millert Exp $ */
+/* $OpenBSD: supmsg.h,v 1.7 2002/06/12 06:07:16 mpech Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -131,7 +131,7 @@ EXTERN int pgmversion; /* version of this program */
EXTERN int protver; /* protocol version of partner */
EXTERN int pgmver; /* program version of partner */
EXTERN char *scmver; /* scm version of partner */
-EXTERN int fspid; /* process id of fileserver */
+EXTERN pid_t fspid; /* process id of fileserver */
/* msgsetup */
EXTERN int xpatch; /* setup crosspatch to a new client */
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index 37877930b09..2e189523064 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commands.c,v 1.41 2002/02/17 17:20:49 millert Exp $ */
+/* $OpenBSD: commands.c,v 1.42 2002/06/12 06:07:16 mpech Exp $ */
/* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */
/*
@@ -2146,8 +2146,8 @@ status(argc, argv)
printf("SIGIO received %d time%s.\r\n",
sigiocount, (sigiocount == 1)? "":"s");
if (In3270) {
- printf("Process ID %d, process group %d.\r\n",
- getpid(), getpgrp());
+ printf("Process ID %ld, process group %ld.\r\n",
+ (long)getpid(), (long)getpgrp());
printf("Terminal input:\r\n");
filestuff(tin);
printf("Terminal output:\r\n");
diff --git a/usr.bin/telnet/sys_bsd.c b/usr.bin/telnet/sys_bsd.c
index af85d4931ed..5b193642403 100644
--- a/usr.bin/telnet/sys_bsd.c
+++ b/usr.bin/telnet/sys_bsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_bsd.c,v 1.12 2002/03/25 10:52:32 hin Exp $ */
+/* $OpenBSD: sys_bsd.c,v 1.13 2002/06/12 06:07:16 mpech Exp $ */
/* $NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $ */
/*
@@ -824,7 +824,7 @@ NetSigIO(fd, onoff)
NetSetPgrp(fd)
int fd;
{
- int myPid;
+ pid_t myPid;
myPid = getpid();
fcntl(fd, F_SETOWN, myPid);
diff --git a/usr.bin/tip/aculib/dn11.c b/usr.bin/tip/aculib/dn11.c
index c84bc05a4e0..ab0effd965b 100644
--- a/usr.bin/tip/aculib/dn11.c
+++ b/usr.bin/tip/aculib/dn11.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dn11.c,v 1.6 2002/05/07 06:56:50 hugh Exp $ */
+/* $OpenBSD: dn11.c,v 1.7 2002/06/12 06:07:16 mpech Exp $ */
/* $NetBSD: dn11.c,v 1.4 1995/10/29 00:49:53 pk Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)dn11.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: dn11.c,v 1.6 2002/05/07 06:56:50 hugh Exp $";
+static const char rcsid[] = "$OpenBSD: dn11.c,v 1.7 2002/06/12 06:07:16 mpech Exp $";
#endif /* not lint */
/*
@@ -49,7 +49,7 @@ static const char rcsid[] = "$OpenBSD: dn11.c,v 1.6 2002/05/07 06:56:50 hugh Exp
void dn_abort();
void alarmtr();
static jmp_buf jmpbuf;
-static int child = -1, dn;
+static pid_t child = -1, dn;
int
dn_dialer(num, acu)
diff --git a/usr.bin/tip/aculib/v831.c b/usr.bin/tip/aculib/v831.c
index b7f54e496fd..2b5576ad049 100644
--- a/usr.bin/tip/aculib/v831.c
+++ b/usr.bin/tip/aculib/v831.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: v831.c,v 1.7 2002/05/07 06:56:50 hugh Exp $ */
+/* $OpenBSD: v831.c,v 1.8 2002/06/12 06:07:16 mpech Exp $ */
/* $NetBSD: v831.c,v 1.5 1996/12/29 10:42:01 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)v831.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: v831.c,v 1.7 2002/05/07 06:56:50 hugh Exp $";
+static const char rcsid[] = "$OpenBSD: v831.c,v 1.8 2002/06/12 06:07:16 mpech Exp $";
#endif /* not lint */
/*
@@ -53,14 +53,15 @@ static int dialit();
static char *sanitize();
static jmp_buf jmpbuf;
-static int child = -1;
+static pid_t child = -1;
int
v831_dialer(num, acu)
char *num, *acu;
{
- int status, pid;
+ int status;
int timelim;
+ pid_t pid;
if (boolean(value(VERBOSE)))
printf("\nstarting call...");
diff --git a/usr.bin/tip/cmds.c b/usr.bin/tip/cmds.c
index 3fc7dbd30b9..192f5247766 100644
--- a/usr.bin/tip/cmds.c
+++ b/usr.bin/tip/cmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmds.c,v 1.14 2002/05/07 06:56:50 hugh Exp $ */
+/* $OpenBSD: cmds.c,v 1.15 2002/06/12 06:07:16 mpech Exp $ */
/* $NetBSD: cmds.c,v 1.7 1997/02/11 09:24:03 mrg Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cmds.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: cmds.c,v 1.14 2002/05/07 06:56:50 hugh Exp $";
+static const char rcsid[] = "$OpenBSD: cmds.c,v 1.15 2002/06/12 06:07:16 mpech Exp $";
#endif /* not lint */
#include "tip.h"
@@ -201,9 +201,10 @@ transfer(buf, fd, eofchars)
void
pipefile()
{
- int cpid, pdes[2];
+ int pdes[2];
char buf[256];
int status, p;
+ pid_t cpid;
if (prompt("Local command? ", buf, sizeof(buf)))
return;
@@ -473,7 +474,8 @@ void
pipeout(c)
{
char buf[256];
- int cpid, status, p;
+ int status, p;
+ pid_t cpid;
time_t start = time(NULL);
putchar(c);
@@ -525,7 +527,8 @@ void
consh(c)
{
char buf[256];
- int cpid, status, p;
+ int status, p;
+ pid_t cpid;
time_t start = time(NULL);
putchar(c);
@@ -574,8 +577,9 @@ consh(c)
void
shell()
{
- int shpid, status;
+ int status;
char *cp;
+ pid_t shpid;
printf("[sh]\r\n");
signal(SIGINT, SIG_IGN);
@@ -875,9 +879,10 @@ expand(name)
{
static char xname[BUFSIZ];
char cmdbuf[BUFSIZ];
- int pid, l;
+ int l;
char *cp, *Shell;
int s, pivec[2];
+ pid_t pid;
if (!anyof(name, "~{[*?$`'\"\\"))
return(name);
diff --git a/usr.bin/tip/uucplock.c b/usr.bin/tip/uucplock.c
index 8c32fd91de7..a787522e8d4 100644
--- a/usr.bin/tip/uucplock.c
+++ b/usr.bin/tip/uucplock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uucplock.c,v 1.8 2002/05/29 09:23:25 deraadt Exp $ */
+/* $OpenBSD: uucplock.c,v 1.9 2002/06/12 06:07:16 mpech Exp $ */
/* $NetBSD: uucplock.c,v 1.7 1997/02/11 09:24:08 mrg Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)uucplock.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: uucplock.c,v 1.8 2002/05/29 09:23:25 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: uucplock.c,v 1.9 2002/06/12 06:07:16 mpech Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -98,8 +98,8 @@ uu_lock(ttyname)
* The process that locked the file isn't running, so
* we'll lock it ourselves
*/
- fprintf(stderr, "Stale lock on %s PID=%d... overriding.\n",
- ttyname, pid);
+ fprintf(stderr, "Stale lock on %s PID=%ld... overriding.\n",
+ ttyname, (long)pid);
if (lseek(fd, (off_t)0, SEEK_SET) < 0) {
perror(tbuf);
(void)close(fd);
diff --git a/usr.bin/tn3270/sys_curses/system.c b/usr.bin/tn3270/sys_curses/system.c
index 15877ee34de..ddb9094b9c8 100644
--- a/usr.bin/tn3270/sys_curses/system.c
+++ b/usr.bin/tn3270/sys_curses/system.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: system.c,v 1.10 2001/11/19 19:02:17 mpech Exp $ */
+/* $OpenBSD: system.c,v 1.11 2002/06/12 06:07:16 mpech Exp $ */
/*-
* Copyright (c) 1988 The Regents of the University of California.
@@ -35,7 +35,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)system.c 4.5 (Berkeley) 4/26/91";*/
-static char rcsid[] = "$OpenBSD: system.c,v 1.10 2001/11/19 19:02:17 mpech Exp $";
+static char rcsid[] = "$OpenBSD: system.c,v 1.11 2002/06/12 06:07:16 mpech Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -86,7 +86,7 @@ static char rcsid[] = "$OpenBSD: system.c,v 1.10 2001/11/19 19:02:17 mpech Exp $
#endif
-static int shell_pid = 0;
+static pid_t shell_pid = 0;
static char key[50]; /* Actual key */
static char *keyname; /* Name of file with key in it */
@@ -593,7 +593,7 @@ child_died(code)
{
int save_errno = errno;
union wait status;
- int pid;
+ pid_t pid;
while ((pid = wait3((int *)&status, WNOHANG, (struct rusage *)0)) > 0) {
if (pid == shell_pid) {
diff --git a/usr.bin/top/display.c b/usr.bin/top/display.c
index 9609d8e149d..551139f0d88 100644
--- a/usr.bin/top/display.c
+++ b/usr.bin/top/display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: display.c,v 1.9 2002/02/16 21:27:55 millert Exp $ */
+/* $OpenBSD: display.c,v 1.10 2002/06/12 06:07:16 mpech Exp $ */
/*
* Top users/processes display for Unix
@@ -50,7 +50,7 @@
FILE *debug;
#endif
-static int lmpid = 0;
+static pid_t lmpid = 0;
static int last_hi = 0; /* used in u_process and u_endscreen */
static int lastline = 0;
static int display_width = MAX_COLS;
@@ -175,7 +175,7 @@ struct statics *statics;
void i_loadave(mpid, avenrun)
-int mpid;
+pid_t mpid;
double *avenrun;
{
@@ -187,7 +187,7 @@ double *avenrun;
/* mpid == -1 implies this system doesn't have an _mpid */
if (mpid != -1)
{
- printf("last pid: %5d; ", mpid);
+ printf("last pid: %5ld; ", (long)mpid);
}
printf("load averages");
@@ -203,7 +203,7 @@ double *avenrun;
void u_loadave(mpid, avenrun)
-int mpid;
+pid_t mpid;
double *avenrun;
{
@@ -215,7 +215,7 @@ double *avenrun;
if (mpid != lmpid)
{
Move_to(x_lastpid, y_lastpid);
- printf("%5d", mpid);
+ printf("%5ld", (long)mpid);
lmpid = mpid;
}
diff --git a/usr.bin/top/machine.h b/usr.bin/top/machine.h
index 62bcd6e4c1a..0609bfef8e7 100644
--- a/usr.bin/top/machine.h
+++ b/usr.bin/top/machine.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: machine.h,v 1.4 2002/02/17 19:42:33 millert Exp $ */
+/* $OpenBSD: machine.h,v 1.5 2002/06/12 06:07:16 mpech Exp $ */
/*
* This file defines the interface between top and the machine-dependent
@@ -25,7 +25,7 @@ struct statics
struct system_info
{
- int last_pid;
+ pid_t last_pid;
double load_avg[NUM_AVERAGES];
int p_total;
int p_active; /* number of procs considered "active" */
diff --git a/usr.bin/vi/common/main.c b/usr.bin/vi/common/main.c
index 55d52fb7196..a54d97c2a61 100644
--- a/usr.bin/vi/common/main.c
+++ b/usr.bin/vi/common/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.8 2002/02/16 21:27:57 millert Exp $ */
+/* $OpenBSD: main.c,v 1.9 2002/06/12 06:07:16 mpech Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -591,8 +591,8 @@ attach(gp)
return;
}
- (void)printf("process %lu waiting, enter <CR> to continue: ",
- (u_long)getpid());
+ (void)printf("process %ld waiting, enter <CR> to continue: ",
+ (long)getpid());
(void)fflush(stdout);
do {
diff --git a/usr.bin/vi/common/msg.c b/usr.bin/vi/common/msg.c
index 197c9769f2e..bae7bdbc85b 100644
--- a/usr.bin/vi/common/msg.c
+++ b/usr.bin/vi/common/msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msg.c,v 1.10 2002/02/19 19:39:39 millert Exp $ */
+/* $OpenBSD: msg.c,v 1.11 2002/06/12 06:07:16 mpech Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -611,7 +611,7 @@ msgq_status(sp, lno, flags)
p += strlen(p);
}
#ifdef DEBUG
- (void)sprintf(p, " (pid %lu)", (u_long)getpid());
+ (void)sprintf(p, " (pid %ld)", (long)getpid());
p += strlen(p);
#endif
*p++ = '\n';
diff --git a/usr.bin/vi/ex/ex_argv.c b/usr.bin/vi/ex/ex_argv.c
index 27dd8022429..160fd0011f8 100644
--- a/usr.bin/vi/ex/ex_argv.c
+++ b/usr.bin/vi/ex/ex_argv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_argv.c,v 1.10 2002/02/17 19:42:34 millert Exp $ */
+/* $OpenBSD: ex_argv.c,v 1.11 2002/06/12 06:07:16 mpech Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -742,7 +742,7 @@ alloc_err: rval = SEXP_ERR;
* This won't catch "echo foo_$5", but that's not a common error and
* historic vi didn't catch it either.
*/
- if (proc_wait(sp, (long)pid, sh, 1, 0))
+ if (proc_wait(sp, pid, sh, 1, 0))
rval = SEXP_EXPANSION_ERR;
for (p = bp; len; ++p, --len)
diff --git a/usr.bin/vi/ex/ex_cscope.c b/usr.bin/vi/ex/ex_cscope.c
index 3abcfc4e41a..4ae8095a0c2 100644
--- a/usr.bin/vi/ex/ex_cscope.c
+++ b/usr.bin/vi/ex/ex_cscope.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_cscope.c,v 1.8 2002/02/17 19:42:34 millert Exp $ */
+/* $OpenBSD: ex_cscope.c,v 1.9 2002/06/12 06:07:16 mpech Exp $ */
/*-
* Copyright (c) 1994, 1996
@@ -953,7 +953,7 @@ cscope_display(sp)
for (i = 1,
csc = exp->cscq.lh_first; csc != NULL; ++i, csc = csc->q.le_next)
ex_printf(sp,
- "%2d %s (process %lu)\n", i, csc->dname, (u_long)csc->pid);
+ "%2d %s (process %ld)\n", i, csc->dname, (long)csc->pid);
return (0);
}
diff --git a/usr.bin/vi/ex/ex_filter.c b/usr.bin/vi/ex/ex_filter.c
index 61505204348..89d610efa39 100644
--- a/usr.bin/vi/ex/ex_filter.c
+++ b/usr.bin/vi/ex/ex_filter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_filter.c,v 1.6 2002/02/17 19:42:34 millert Exp $ */
+/* $OpenBSD: ex_filter.c,v 1.7 2002/06/12 06:07:17 mpech Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -260,7 +260,7 @@ err: if (input[0] != -1)
/* Wait for the parent-writer. */
if (proc_wait(sp,
- (long)parent_writer_pid, "parent-writer", 0, 1))
+ parent_writer_pid, "parent-writer", 0, 1))
rval = 1;
/* Delete any lines written to the utility. */
@@ -287,7 +287,7 @@ err: if (input[0] != -1)
* Ignore errors on vi file reads, to make reads prettier. It's
* completely inconsistent, and historic practice.
*/
-uwait: return (proc_wait(sp, (long)utility_pid, cmd,
+uwait: return (proc_wait(sp, utility_pid, cmd,
ftype == FILTER_READ && F_ISSET(sp, SC_VI) ? 1 : 0, 0) || rval);
}
diff --git a/usr.bin/vi/ex/ex_script.c b/usr.bin/vi/ex/ex_script.c
index c7f1f887e76..6d8a11813f7 100644
--- a/usr.bin/vi/ex/ex_script.c
+++ b/usr.bin/vi/ex/ex_script.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_script.c,v 1.8 2002/02/16 21:27:57 millert Exp $ */
+/* $OpenBSD: ex_script.c,v 1.9 2002/06/12 06:07:17 mpech Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -599,7 +599,7 @@ sscr_end(sp)
(void)close(sc->sh_slave);
/* This should have killed the child. */
- (void)proc_wait(sp, (long)sc->sh_pid, "script-shell", 0, 0);
+ (void)proc_wait(sp, sc->sh_pid, "script-shell", 0, 0);
/* Free memory. */
free(sc->sh_prompt);
diff --git a/usr.bin/vi/ex/ex_shell.c b/usr.bin/vi/ex/ex_shell.c
index 0ae30bc9cd4..e5ce2832654 100644
--- a/usr.bin/vi/ex/ex_shell.c
+++ b/usr.bin/vi/ex/ex_shell.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_shell.c,v 1.8 2002/02/16 21:27:57 millert Exp $ */
+/* $OpenBSD: ex_shell.c,v 1.9 2002/06/12 06:07:17 mpech Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -133,7 +133,7 @@ ex_exec_proc(sp, cmdp, cmd, msg, need_newline)
_exit(127);
/* NOTREACHED */
default: /* Parent. */
- return (proc_wait(sp, (long)pid, cmd, 0, 0));
+ return (proc_wait(sp, pid, cmd, 0, 0));
}
/* NOTREACHED */
}
@@ -148,12 +148,12 @@ ex_exec_proc(sp, cmdp, cmd, msg, need_newline)
* rules get you. I'm using a long based on the belief that nobody is
* going to make it unsigned and it's unlikely to be a quad.
*
- * PUBLIC: int proc_wait(SCR *, long, const char *, int, int);
+ * PUBLIC: int proc_wait(SCR *, pid_t, const char *, int, int);
*/
int
proc_wait(sp, pid, cmd, silent, okpipe)
SCR *sp;
- long pid;
+ pid_t pid;
const char *cmd;
int silent, okpipe;
{
@@ -164,7 +164,7 @@ proc_wait(sp, pid, cmd, silent, okpipe)
/* Wait for the utility, ignoring interruptions. */
for (;;) {
errno = 0;
- if (waitpid((pid_t)pid, &pstat, 0) != -1)
+ if (waitpid(pid, &pstat, 0) != -1)
break;
if (errno != EINTR) {
msgq(sp, M_SYSERR, "waitpid");
diff --git a/usr.bin/vi/include/ex_extern.h b/usr.bin/vi/include/ex_extern.h
index e787ed1ae9a..51141e8d208 100644
--- a/usr.bin/vi/include/ex_extern.h
+++ b/usr.bin/vi/include/ex_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_extern.h,v 1.7 2002/02/17 19:42:34 millert Exp $ */
+/* $OpenBSD: ex_extern.h,v 1.8 2002/06/12 06:07:17 mpech Exp $ */
int ex(SCR **);
int ex_cmd(SCR *);
@@ -78,7 +78,7 @@ int sscr_end(SCR *);
int ex_set(SCR *, EXCMD *);
int ex_shell(SCR *, EXCMD *);
int ex_exec_proc(SCR *, EXCMD *, char *, const char *, int);
-int proc_wait(SCR *, long, const char *, int, int);
+int proc_wait(SCR *, pid_t, const char *, int, int);
int ex_shiftl(SCR *, EXCMD *);
int ex_shiftr(SCR *, EXCMD *);
int ex_source(SCR *, EXCMD *);
diff --git a/usr.bin/window/ww.h b/usr.bin/window/ww.h
index aed54113c62..fe8c6ef4456 100644
--- a/usr.bin/window/ww.h
+++ b/usr.bin/window/ww.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ww.h,v 1.7 2000/04/14 18:43:34 millert Exp $ */
+/* $OpenBSD: ww.h,v 1.8 2002/06/12 06:07:17 mpech Exp $ */
/* $NetBSD: ww.h,v 1.9 1996/10/12 23:46:23 christos Exp $ */
/*
@@ -122,7 +122,7 @@ struct ww {
#define WWP_STOPPED 0x0200 /* output stopped */
int ww_pty; /* file descriptor of pty or socket pair */
int ww_socket; /* other end of socket pair */
- int ww_pid; /* pid of process, if WWS_HASPROC true */
+ pid_t ww_pid; /* pid of process, if WWS_HASPROC true */
char ww_ttyname[11]; /* "/dev/ttyp?" */
char *ww_ob; /* output buffer */
char *ww_obe; /* end of ww_ob */
diff --git a/usr.bin/window/wwchild.c b/usr.bin/window/wwchild.c
index 551995309ba..68ecccce55a 100644
--- a/usr.bin/window/wwchild.c
+++ b/usr.bin/window/wwchild.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wwchild.c,v 1.5 2001/11/19 19:02:18 mpech Exp $ */
+/* $OpenBSD: wwchild.c,v 1.6 2002/06/12 06:07:17 mpech Exp $ */
/* $NetBSD: wwchild.c,v 1.3 1995/09/28 10:35:13 tls Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)wwchild.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: wwchild.c,v 1.5 2001/11/19 19:02:18 mpech Exp $";
+static char rcsid[] = "$OpenBSD: wwchild.c,v 1.6 2002/06/12 06:07:17 mpech Exp $";
#endif
#endif /* not lint */
@@ -56,7 +56,7 @@ wwchild()
int olderrno;
struct ww **wp;
int w;
- int pid;
+ pid_t pid;
char collected = 0;
olderrno = errno;
diff --git a/usr.bin/window/wwenviron.c b/usr.bin/window/wwenviron.c
index 12acc8563d7..9a4d719373d 100644
--- a/usr.bin/window/wwenviron.c
+++ b/usr.bin/window/wwenviron.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wwenviron.c,v 1.6 2001/11/19 19:02:18 mpech Exp $ */
+/* $OpenBSD: wwenviron.c,v 1.7 2002/06/12 06:07:17 mpech Exp $ */
/* $NetBSD: wwenviron.c,v 1.4 1995/12/21 08:39:50 mycroft Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)wwenviron.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: wwenviron.c,v 1.6 2001/11/19 19:02:18 mpech Exp $";
+static char rcsid[] = "$OpenBSD: wwenviron.c,v 1.7 2002/06/12 06:07:17 mpech Exp $";
#endif
#endif /* not lint */
@@ -59,7 +59,7 @@ struct ww *wp;
{
int i;
#ifndef TIOCSCTTY
- int pgrp = getpid();
+ pid_t pgrp = getpid();
#endif
char buf[1024];
sigset_t sigset;
diff --git a/usr.bin/window/wwspawn.c b/usr.bin/window/wwspawn.c
index e1b99492c4d..dea85fccc79 100644
--- a/usr.bin/window/wwspawn.c
+++ b/usr.bin/window/wwspawn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wwspawn.c,v 1.6 2001/11/19 19:02:18 mpech Exp $ */
+/* $OpenBSD: wwspawn.c,v 1.7 2002/06/12 06:07:17 mpech Exp $ */
/* $NetBSD: wwspawn.c,v 1.4 1995/12/21 08:39:57 mycroft Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)wwspawn.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: wwspawn.c,v 1.6 2001/11/19 19:02:18 mpech Exp $";
+static char rcsid[] = "$OpenBSD: wwspawn.c,v 1.7 2002/06/12 06:07:17 mpech Exp $";
#endif
#endif /* not lint */
@@ -57,8 +57,8 @@ struct ww *wp;
char *file;
char **argv;
{
- int pid;
- int ret;
+ pid_t pid;
+ pid_t ret;
char erred = 0;
sigset_t sigset, osigset;
diff --git a/usr.bin/xlint/xlint/xlint.c b/usr.bin/xlint/xlint/xlint.c
index 6386b5c8063..497aaaaa4d3 100644
--- a/usr.bin/xlint/xlint/xlint.c
+++ b/usr.bin/xlint/xlint/xlint.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xlint.c,v 1.9 2002/03/14 06:51:42 mpech Exp $ */
+/* $OpenBSD: xlint.c,v 1.10 2002/06/12 06:07:17 mpech Exp $ */
/* $NetBSD: xlint.c,v 1.3 1995/10/23 14:29:30 jpo Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: xlint.c,v 1.9 2002/03/14 06:51:42 mpech Exp $";
+static char rcsid[] = "$OpenBSD: xlint.c,v 1.10 2002/06/12 06:07:17 mpech Exp $";
#endif
#include <sys/param.h>
@@ -611,7 +611,8 @@ runchild(path, args, crfn)
const char *path, *crfn;
char *const *args;
{
- int status, rv, signo, i;
+ int status, signo, i;
+ pid_t rv;
if (Vflag) {
for (i = 0; args[i] != NULL; i++)