diff options
author | 2002-05-26 09:24:35 +0000 | |
---|---|---|
committer | 2002-05-26 09:24:35 +0000 | |
commit | 13ee8a54b862cc0dfd91f39c641da06af64cc2b2 (patch) | |
tree | cc15bdee8a5aa91ccbc87bc82fc9585d9342b76d | |
parent | - CPU_MAXID and CPU_CHIPSET were swapped in cpu.h (diff) | |
download | wireguard-openbsd-13ee8a54b862cc0dfd91f39c641da06af64cc2b2.tar.xz wireguard-openbsd-13ee8a54b862cc0dfd91f39c641da06af64cc2b2.zip |
pid_t cleanup
38 files changed, 153 insertions, 133 deletions
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index a10ecf37702..892a0f3a006 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: syslog.c,v 1.16 2002/02/19 19:39:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: syslog.c,v 1.17 2002/05/26 09:29:02 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -206,7 +206,7 @@ vsyslog_r(pri, data, fmt, ap) DEC(); } if (data->log_stat & LOG_PID) { - prlen = snprintf(p, tbuf_left, "[%d]", getpid()); + prlen = snprintf(p, tbuf_left, "[%ld]", (long)getpid()); DEC(); } if (data->log_tag != NULL) { diff --git a/lib/libc/stdlib/system.c b/lib/libc/stdlib/system.c index dadf3fe8419..636a9ebdffa 100644 --- a/lib/libc/stdlib/system.c +++ b/lib/libc/stdlib/system.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: system.c,v 1.4 2001/09/04 23:35:58 millert Exp $"; +static char *rcsid = "$OpenBSD: system.c,v 1.5 2002/05/26 09:29:02 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -62,7 +62,7 @@ system(command) sigemptyset(&mask); sigaddset(&mask, SIGCHLD); sigprocmask(SIG_BLOCK, &mask, &omask); - switch(pid = vfork()) { + switch (pid = vfork()) { case -1: /* error */ sigprocmask(SIG_SETMASK, &omask, NULL); return(-1); @@ -78,5 +78,5 @@ system(command) sigprocmask(SIG_SETMASK, &omask, NULL); (void)signal(SIGINT, intsave); (void)signal(SIGQUIT, quitsave); - return(pid == -1 ? -1 : pstat); + return (pid == -1 ? -1 : pstat); } diff --git a/lib/libutil/pidfile.c b/lib/libutil/pidfile.c index ae6e9342b3b..7c5a1e7453a 100644 --- a/lib/libutil/pidfile.c +++ b/lib/libutil/pidfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pidfile.c,v 1.4 2002/05/22 01:21:40 itojun Exp $ */ +/* $OpenBSD: pidfile.c,v 1.5 2002/05/26 09:29:02 deraadt Exp $ */ /* $NetBSD: pidfile.c,v 1.4 2001/02/19 22:43:42 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$OpenBSD: pidfile.c,v 1.4 2002/05/22 01:21:40 itojun Exp $"; +static const char rcsid[] = "$OpenBSD: pidfile.c,v 1.5 2002/05/26 09:29:02 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -85,7 +85,7 @@ pidfile(const char *basename) } pid = getpid(); - if (fprintf(f, "%d\n", pid) <= 0 || fclose(f) != 0) { + if (fprintf(f, "%ld\n", (long)pid) <= 0 || fclose(f) != 0) { save_errno = errno; (void) unlink(pidfile_path); free(pidfile_path); diff --git a/lib/libutil/uucplock.c b/lib/libutil/uucplock.c index 0d4c0bba18d..ff12b6360ff 100644 --- a/lib/libutil/uucplock.c +++ b/lib/libutil/uucplock.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: uucplock.c,v 1.8 2002/02/16 21:27:29 millert Exp $*/ +/* * $OpenBSD: uucplock.c,v 1.9 2002/05/26 09:29:02 deraadt Exp $*/ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -52,7 +52,7 @@ static const char sccsid[] = "@(#)uucplock.c 8.1 (Berkeley) 6/6/93"; #define MAXTRIES 5 -#define LOCKTMP "LCKTMP..%d" +#define LOCKTMP "LCKTMP..%ld" #define LOCKFMT "LCK..%s" #define GORET(level, val) { err = errno; uuerr = (val); \ @@ -78,7 +78,7 @@ uu_lock(ttyname) pid = getpid(); (void)snprintf(lcktmpname, sizeof(lcktmpname), _PATH_UUCPLOCK LOCKTMP, - pid); + (long)pid); (void)snprintf(lckname, sizeof(lckname), _PATH_UUCPLOCK LOCKFMT, ttyname); if ((tmpfd = creat(lcktmpname, 0664)) < 0) @@ -211,7 +211,7 @@ put_pid(fd, pid) char buf[32]; int len; - len = sprintf (buf, "%10d\n", (int)pid); + len = snprintf(buf, sizeof buf, "%10ld\n", (long)pid); if (write (fd, buf, len) == len) { /* We don't mind too much if ftruncate() fails - see get_pid */ diff --git a/lib/libwrap/update.c b/lib/libwrap/update.c index aac3807755f..2a5223cac89 100644 --- a/lib/libwrap/update.c +++ b/lib/libwrap/update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: update.c,v 1.4 2002/02/19 19:39:38 millert Exp $ */ +/* $OpenBSD: update.c,v 1.5 2002/05/26 09:29:02 deraadt Exp $ */ /* * Routines for controlled update/initialization of request structures. @@ -19,7 +19,7 @@ #if 0 static char sccsid[] = "@(#) update.c 1.1 94/12/28 17:42:56"; #else -static char rcsid[] = "$OpenBSD: update.c,v 1.4 2002/02/19 19:39:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: update.c,v 1.5 2002/05/26 09:29:02 deraadt Exp $"; #endif #endif @@ -104,7 +104,7 @@ struct request_info *request_init(struct request_info *request, ...) *request = default_info; request->fd = -1; strlcpy(request->daemon, unknown, sizeof(request->daemon)); - snprintf(request->pid, sizeof(request->pid), "%d", getpid()); + snprintf(request->pid, sizeof(request->pid), "%ld", (long)getpid()); request->client->request = request; request->server->request = request; r = request_fill(request, ap); diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 4e3a465c948..d8624462bdf 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftpd.c,v 1.125 2002/03/30 22:01:51 deraadt Exp $ */ +/* $OpenBSD: ftpd.c,v 1.126 2002/05/26 09:32:07 deraadt Exp $ */ /* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */ /* @@ -73,7 +73,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94"; #else -static char rcsid[] = "$OpenBSD: ftpd.c,v 1.125 2002/03/30 22:01:51 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ftpd.c,v 1.126 2002/05/26 09:32:07 deraadt Exp $"; #endif #endif /* not lint */ @@ -474,7 +474,7 @@ main(argc, argv, envp) } /* set this here so klogin can use it... */ - (void)snprintf(ttyline, sizeof(ttyline), "ftp%d", getpid()); + (void)snprintf(ttyline, sizeof(ttyline), "ftp%ld", (long)getpid()); sa.sa_handler = SIG_DFL; (void) sigaction(SIGCHLD, &sa, NULL); diff --git a/libexec/ftpd/popen.c b/libexec/ftpd/popen.c index acf15a6f934..4e83ddf02e1 100644 --- a/libexec/ftpd/popen.c +++ b/libexec/ftpd/popen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: popen.c,v 1.14 2002/01/23 16:31:18 mpech Exp $ */ +/* $OpenBSD: popen.c,v 1.15 2002/05/26 09:32:07 deraadt Exp $ */ /* $NetBSD: popen.c,v 1.5 1995/04/11 02:45:00 cgd Exp $ */ /* @@ -78,7 +78,8 @@ ftpd_popen(program, type) { char *cp; FILE *iop; - int argc, gargc, pdes[2], pid; + int argc, gargc, pdes[2]; + pid_t pid; char **pop, *argv[MAX_ARGV], *gargv[MAX_GARGV]; if ((*type != 'r' && *type != 'w') || type[1]) @@ -127,7 +128,7 @@ ftpd_popen(program, type) iop = NULL; - switch(pid = fork()) { + switch (pid = fork()) { case -1: /* error */ (void)close(pdes[0]); (void)close(pdes[1]); diff --git a/libexec/login_chpass/login_chpass.c b/libexec/login_chpass/login_chpass.c index c05d9e036e8..f862dce98f1 100644 --- a/libexec/login_chpass/login_chpass.c +++ b/libexec/login_chpass/login_chpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: login_chpass.c,v 1.6 2002/02/16 21:27:30 millert Exp $ */ +/* $OpenBSD: login_chpass.c,v 1.7 2002/05/26 09:32:08 deraadt Exp $ */ /*- * Copyright (c) 1995,1996 Berkeley Software Design, Inc. All rights reserved. @@ -309,8 +309,8 @@ krb_chpass(username, instance, argv) krb_get_default_principal(principal.name, principal.instance, principal.realm); - snprintf(tktstring, sizeof(tktstring), "%s.chpass.%s.%d", - TKT_ROOT, username, getpid()); + snprintf(tktstring, sizeof(tktstring), "%s.chpass.%s.%ld", + TKT_ROOT, username, (long)getpid()); krb_set_tkt_string(tktstring); (void)setpriority(PRIO_PROCESS, 0, -4); diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c index 7ce3816c50c..dc138e05f6a 100644 --- a/libexec/rshd/rshd.c +++ b/libexec/rshd/rshd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rshd.c,v 1.45 2002/05/22 06:35:44 deraadt Exp $ */ +/* $OpenBSD: rshd.c,v 1.46 2002/05/26 09:32:08 deraadt Exp $ */ /*- * Copyright (c) 1988, 1989, 1992, 1993, 1994 @@ -41,7 +41,7 @@ static char copyright[] = #ifndef lint /* from: static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; */ -static char *rcsid = "$OpenBSD: rshd.c,v 1.45 2002/05/22 06:35:44 deraadt Exp $"; +static char *rcsid = "$OpenBSD: rshd.c,v 1.46 2002/05/26 09:32:08 deraadt Exp $"; #endif /* not lint */ /* @@ -215,8 +215,8 @@ doit(fromp) u_short port; in_port_t *portp; fd_set ready, readfrom; - int cc, nfd, pv[2], pid, s = 0; - int one = 1; + int cc, nfd, pv[2], s = 0, one = 1; + pid_t pid; char *hostname, *errorstr, *errorhost = (char *) NULL; char *cp, sig, buf[BUFSIZ]; char cmdbuf[NCARGS+1], locuser[_PW_NAME_LEN+1], remuser[_PW_NAME_LEN+1]; diff --git a/libexec/uucpd/uucpd.c b/libexec/uucpd/uucpd.c index abbe2cac44d..f4187effc7a 100644 --- a/libexec/uucpd/uucpd.c +++ b/libexec/uucpd/uucpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uucpd.c,v 1.22 2002/05/22 06:35:44 deraadt Exp $ */ +/* $OpenBSD: uucpd.c,v 1.23 2002/05/26 09:32:08 deraadt Exp $ */ /* * Copyright (c) 1985 The Regents of the University of California. @@ -44,7 +44,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)uucpd.c 5.10 (Berkeley) 2/26/91";*/ -static char rcsid[] = "$OpenBSD: uucpd.c,v 1.22 2002/05/22 06:35:44 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: uucpd.c,v 1.23 2002/05/26 09:32:08 deraadt Exp $"; #endif /* not lint */ /* @@ -79,9 +79,9 @@ void dologout(void); void dologin(struct passwd *, struct sockaddr_in *); struct sockaddr_in hisctladdr; -int hisaddrlen = sizeof hisctladdr; +int hisaddrlen = sizeof hisctladdr; struct sockaddr_in myctladdr; -int mypid; +pid_t mypid; char Username[64], Loginname[64]; char *nenv[] = { @@ -117,7 +117,7 @@ char **argv; } if ((childpid = fork()) == 0) doit(&hisctladdr); - snprintf(utline, sizeof(utline), "uucp%.4d", childpid); + snprintf(utline, sizeof(utline), "uucp%.4ld", (long)childpid); dologout(); exit(1); #else /* !BSDINETD */ @@ -128,7 +128,7 @@ char **argv; } if (fork()) exit(0); - snprintf(utline, sizeof(utline), "uucp%.4d", childpid); + snprintf(utline, sizeof(utline), "uucp%.4ld", (long)childpid); if ((s=open(_PATH_TTY, 2)) >= 0){ ioctl(s, TIOCNOTTY, (char *)0); @@ -260,7 +260,8 @@ void dologout() { int save_errno = errno; - int status, pid, wtmp; + int status, wtmp; + pid_t pid; #ifdef BSDINETD while ((pid=wait(&status)) > 0) { @@ -306,7 +307,7 @@ struct sockaddr_in *sin; wtmp = open(_PATH_WTMP, O_WRONLY|O_APPEND); if (wtmp >= 0) { /* hack, but must be unique and no tty line */ - (void) snprintf(line, sizeof line, "uucp%.4d", getpid()); + (void) snprintf(line, sizeof line, "uucp%.4ld", (long)getpid()); SCPYN(utmp.ut_line, line); SCPYN(utmp.ut_name, pw->pw_name); SCPYN(utmp.ut_host, remotehost); diff --git a/sbin/fsck/preen.c b/sbin/fsck/preen.c index 746e85c614f..f832e330c77 100644 --- a/sbin/fsck/preen.c +++ b/sbin/fsck/preen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: preen.c,v 1.9 2002/03/14 06:51:41 mpech Exp $ */ +/* $OpenBSD: preen.c,v 1.10 2002/05/26 09:24:35 deraadt Exp $ */ /* $NetBSD: preen.c,v 1.15 1996/09/28 19:21:42 christos Exp $ */ /* @@ -94,9 +94,10 @@ checkfstab(flags, maxrun, docheck, checkit) struct fstab *fs; struct diskentry *d, *nextdisk; struct partentry *p; - int ret, pid, retcode, passno, sumstatus, status; + int ret, retcode, passno, sumstatus, status; void *auxarg; char *name; + pid_t pid; TAILQ_INIT(&badh); TAILQ_INIT(&diskh); @@ -165,7 +166,7 @@ checkfstab(flags, maxrun, docheck, checkit) break; if (d == NULL) { - warnx("Unknown pid %d", pid); + warnx("Unknown pid %ld", (long)pid); continue; } diff --git a/sbin/fsck_ext2fs/preen.c b/sbin/fsck_ext2fs/preen.c index a235d4205e7..408342c268d 100644 --- a/sbin/fsck_ext2fs/preen.c +++ b/sbin/fsck_ext2fs/preen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: preen.c,v 1.6 2002/02/17 19:42:27 millert Exp $ */ +/* $OpenBSD: preen.c,v 1.7 2002/05/26 09:24:35 deraadt Exp $ */ /* $NetBSD: preen.c,v 1.2 1997/09/14 14:27:30 lukem Exp $ */ /* @@ -56,7 +56,7 @@ struct disk { char *name; /* disk base name */ struct disk *next; /* forward link for list of disks */ struct part *part; /* head of list of partitions on disk */ - int pid; /* If != 0, pid of proc working on */ + pid_t pid; /* If != 0, pid of proc working on */ } *disks; int nrun, ndisks; @@ -74,9 +74,10 @@ checkfstab(preen, maxrun, docheck, chkit) struct fstab *fsp; struct disk *dk, *nextdisk; struct part *pt; - int ret, pid, retcode, passno, sumstatus, status; + int ret, retcode, passno, sumstatus, status; long auxdata; char *name; + pid_t pid; sumstatus = 0; for (passno = 1; passno <= 2; passno++) { @@ -126,7 +127,7 @@ checkfstab(preen, maxrun, docheck, chkit) if (dk->pid == pid) break; if (dk == 0) { - printf("Unknown pid %d\n", pid); + printf("Unknown pid %ld\n", (long)pid); continue; } if (WIFEXITED(status)) diff --git a/sbin/isakmpd/isakmpd.c b/sbin/isakmpd/isakmpd.c index add4ba90767..13c26121018 100644 --- a/sbin/isakmpd/isakmpd.c +++ b/sbin/isakmpd/isakmpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isakmpd.c,v 1.39 2001/12/11 01:54:34 ho Exp $ */ +/* $OpenBSD: isakmpd.c,v 1.40 2002/05/26 09:24:35 deraadt Exp $ */ /* $EOM: isakmpd.c,v 1.54 2000/10/05 09:28:22 niklas Exp $ */ /* @@ -333,7 +333,7 @@ write_pid_file (void) if (fp != NULL) { /* XXX Error checking! */ - fprintf (fp, "%d\n", getpid ()); + fprintf (fp, "%ld\n", (long) getpid ()); fclose (fp); } else diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c index c20ef22b4af..d2fe21a1fd2 100644 --- a/sbin/isakmpd/pf_key_v2.c +++ b/sbin/isakmpd/pf_key_v2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_key_v2.c,v 1.97 2002/02/21 20:12:56 angelos Exp $ */ +/* $OpenBSD: pf_key_v2.c,v 1.98 2002/05/26 09:24:35 deraadt Exp $ */ /* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */ /* @@ -379,8 +379,8 @@ pf_key_v2_read (u_int32_t seq) { LOG_DBG ((LOG_SYSDEP, 90, "pf_key_v2_read:" - "bad version (%d) or PID (%d, mine is %d), ignored", - msg->sadb_msg_version, msg->sadb_msg_pid, + "bad version (%d) or PID (%ld, mine is %d), ignored", + msg->sadb_msg_version, (long)msg->sadb_msg_pid, getpid ())); goto cleanup; } diff --git a/sbin/mount_portal/mount_portal.c b/sbin/mount_portal/mount_portal.c index ab7511eceef..38dd40697cd 100644 --- a/sbin/mount_portal/mount_portal.c +++ b/sbin/mount_portal/mount_portal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_portal.c,v 1.19 2002/05/22 08:21:02 deraadt Exp $ */ +/* $OpenBSD: mount_portal.c,v 1.20 2002/05/26 09:24:35 deraadt Exp $ */ /* $NetBSD: mount_portal.c,v 1.8 1996/04/13 01:31:54 jtc Exp $ */ /* @@ -47,7 +47,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_portal.c 8.6 (Berkeley) 4/26/95"; #else -static char rcsid[] = "$OpenBSD: mount_portal.c,v 1.19 2002/05/22 08:21:02 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: mount_portal.c,v 1.20 2002/05/26 09:24:35 deraadt Exp $"; #endif #endif /* not lint */ @@ -194,7 +194,7 @@ main(argc, argv) */ daemon(0, 0); - (void)snprintf(tag, sizeof(tag), "portal:%d", getpid()); + (void)snprintf(tag, sizeof(tag), "portal:%ld", (long)getpid()); args.pa_config = tag; /* diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index 42a4ef92177..e4a420f5c72 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mountd.c,v 1.45 2002/04/23 18:54:12 espie Exp $ */ +/* $OpenBSD: mountd.c,v 1.46 2002/05/26 09:24:35 deraadt Exp $ */ /* $NetBSD: mountd.c,v 1.31 1996/02/18 11:57:53 fvdl Exp $ */ /* @@ -285,7 +285,7 @@ main(argc, argv) } else { pidfile = fopen(_PATH_MOUNTDPID, "w"); } - fprintf(pidfile, "%d\n", getpid()); + fprintf(pidfile, "%ld\n", (long)getpid()); fclose(pidfile); signal(SIGHUP, (void (*)(int)) new_exportlist); diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 3ccea89e879..db1ceb4403d 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newfs.c,v 1.34 2002/05/06 19:25:06 millert Exp $ */ +/* $OpenBSD: newfs.c,v 1.35 2002/05/26 09:24:35 deraadt Exp $ */ /* $NetBSD: newfs.c,v 1.20 1996/05/16 07:13:03 thorpej Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)newfs.c 8.8 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: newfs.c,v 1.34 2002/05/06 19:25:06 millert Exp $"; +static char rcsid[] = "$OpenBSD: newfs.c,v 1.35 2002/05/26 09:24:35 deraadt Exp $"; #endif #endif /* not lint */ @@ -589,7 +589,7 @@ havelabel: if (mfs) { struct mfs_args args; - sprintf(buf, "mfs:%d", getpid()); + sprintf(buf, "mfs:%ld", (long)getpid()); args.fspec = buf; args.export_info.ex_root = -2; if (mntflags & MNT_RDONLY) diff --git a/sbin/route/route.c b/sbin/route/route.c index b1df9d868b8..6750a6e2264 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.45 2002/05/20 23:06:27 itojun Exp $ */ +/* $OpenBSD: route.c,v 1.46 2002/05/26 09:24:35 deraadt Exp $ */ /* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94"; #else -static char rcsid[] = "$OpenBSD: route.c,v 1.45 2002/05/20 23:06:27 itojun Exp $"; +static char rcsid[] = "$OpenBSD: route.c,v 1.46 2002/05/26 09:24:35 deraadt Exp $"; #endif #endif /* not lint */ @@ -1492,8 +1492,8 @@ print_rtmsg(rtm, msglen) pmsg_addrs((char *)(ifam + 1), ifam->ifam_addrs); break; default: - (void) printf("pid: %d, seq %d, errno %d, flags:", - rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno); + (void) printf("pid: %ld, seq %d, errno %d, flags:", + (long)rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno); bprintf(stdout, rtm->rtm_flags, routeflags); pmsg_common(rtm); } diff --git a/sbin/routed/table.c b/sbin/routed/table.c index 2aefbbc9ea7..584ff692e12 100644 --- a/sbin/routed/table.c +++ b/sbin/routed/table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table.c,v 1.7 2002/03/14 16:44:24 mpech Exp $ */ +/* $OpenBSD: table.c,v 1.8 2002/05/26 09:24:35 deraadt Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -1091,7 +1091,7 @@ read_rt(void) strcpy(str, rtm_type_name(m.r.rtm.rtm_type)); strp = &str[strlen(str)]; if (m.r.rtm.rtm_type <= RTM_CHANGE) - strp += sprintf(strp," from pid %d",m.r.rtm.rtm_pid); + strp += sprintf(strp," from pid %ld", (long)m.r.rtm.rtm_pid); rt_xaddrs(&info, m.r.addrs, &m.r.addrs[RTAX_MAX], m.r.rtm.rtm_addrs); diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c index bd8770f1fa4..71a01c6f3f4 100644 --- a/sbin/shutdown/shutdown.c +++ b/sbin/shutdown/shutdown.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shutdown.c,v 1.24 2002/02/16 21:27:38 millert Exp $ */ +/* $OpenBSD: shutdown.c,v 1.25 2002/05/26 09:24:35 deraadt Exp $ */ /* $NetBSD: shutdown.c,v 1.9 1995/03/18 15:01:09 cgd Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)shutdown.c 8.2 (Berkeley) 2/16/94"; #else -static char rcsid[] = "$OpenBSD: shutdown.c,v 1.24 2002/02/16 21:27:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: shutdown.c,v 1.25 2002/05/26 09:24:35 deraadt Exp $"; #endif #endif /* not lint */ @@ -229,13 +229,13 @@ main(argc, argv) #else (void)setpriority(PRIO_PROCESS, 0, PRIO_MIN); { - int forkpid; + pid_t forkpid; forkpid = fork(); if (forkpid == -1) err(1, "fork"); if (forkpid) { - (void)printf("shutdown: [pid %d]\n", forkpid); + (void)printf("shutdown: [pid %ld]\n", (long)forkpid); exit(0); } } diff --git a/sbin/slattach/slattach.c b/sbin/slattach/slattach.c index 0a8bd7280fb..10aa62fe797 100644 --- a/sbin/slattach/slattach.c +++ b/sbin/slattach/slattach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: slattach.c,v 1.12 2002/02/16 21:27:38 millert Exp $ */ +/* $OpenBSD: slattach.c,v 1.13 2002/05/26 09:24:35 deraadt Exp $ */ /* $NetBSD: slattach.c,v 1.17 1996/05/19 21:57:39 jonathan Exp $ */ /* @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)slattach.c 8.2 (Berkeley) 1/7/94"; #else -static char rcsid[] = "$OpenBSD: slattach.c,v 1.12 2002/02/16 21:27:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: slattach.c,v 1.13 2002/05/26 09:24:35 deraadt Exp $"; #endif #endif /* not lint */ @@ -168,7 +168,7 @@ main(argc, argv) "%sslip.%s.pid", _PATH_VARRUN, dev + i); truncate(pidfilename, 0); /* If this fails, so will the next one... */ if ((pidfile = fopen(pidfilename, "w")) != NULL) { - fprintf(pidfile, "%d\n", pid); + fprintf(pidfile, "%ld\n", (long)pid); (void) fclose(pidfile); } else { syslog(LOG_ERR, "Failed to create pid file %s: %m", pidfilename); diff --git a/usr.bin/time/time.c b/usr.bin/time/time.c index f240cae5759..51d90ee646c 100644 --- a/usr.bin/time/time.c +++ b/usr.bin/time/time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: time.c,v 1.12 2002/02/16 21:27:55 millert Exp $ */ +/* $OpenBSD: time.c,v 1.13 2002/05/26 09:27:10 deraadt Exp $ */ /* $NetBSD: time.c,v 1.7 1995/06/27 00:34:00 jtc Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)time.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: time.c,v 1.12 2002/02/16 21:27:55 millert Exp $"; +static char rcsid[] = "$OpenBSD: time.c,v 1.13 2002/05/26 09:27:10 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -70,7 +70,7 @@ main(argc, argv) int argc; char **argv; { - int pid; + pid_t pid; int ch, status; struct timeval before, after; struct rusage ru; diff --git a/usr.bin/wall/ttymsg.c b/usr.bin/wall/ttymsg.c index 859ad83907a..1fb6194eee4 100644 --- a/usr.bin/wall/ttymsg.c +++ b/usr.bin/wall/ttymsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttymsg.c,v 1.9 2001/11/19 19:02:17 mpech Exp $ */ +/* $OpenBSD: ttymsg.c,v 1.10 2002/05/26 09:27:11 deraadt Exp $ */ /* $NetBSD: ttymsg.c,v 1.3 1994/11/17 07:17:55 jtc Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static const char sccsid[] = "@(#)ttymsg.c 8.2 (Berkeley) 11/16/93"; #endif -static const char rcsid[] = "$OpenBSD: ttymsg.c,v 1.9 2001/11/19 19:02:17 mpech Exp $"; +static const char rcsid[] = "$OpenBSD: ttymsg.c,v 1.10 2002/05/26 09:27:11 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -139,7 +139,8 @@ ttymsg(iov, iovcnt, line, tmout) continue; } if (errno == EWOULDBLOCK) { - int cpid, off = 0; + int off = 0; + pid_t cpid; if (forked) { (void) close(fd); diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c index 1b6d4249881..4c6e19a4119 100644 --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arp.c,v 1.21 2002/03/14 16:44:24 mpech Exp $ */ +/* $OpenBSD: arp.c,v 1.22 2002/05/26 09:25:21 deraadt Exp $ */ /* $NetBSD: arp.c,v 1.12 1995/04/24 13:25:18 cgd Exp $ */ /* @@ -45,7 +45,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)arp.c 8.2 (Berkeley) 1/2/94";*/ -static char *rcsid = "$OpenBSD: arp.c,v 1.21 2002/03/14 16:44:24 mpech Exp $"; +static char *rcsid = "$OpenBSD: arp.c,v 1.22 2002/05/26 09:25:21 deraadt Exp $"; #endif /* not lint */ /* @@ -91,7 +91,7 @@ int rtmsg(int); int set(int, char **); void usage(void); -static int pid; +static pid_t pid; static int nflag; /* no reverse dns lookups */ static int aflag; /* do it for all entries */ static int s = -1; diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c index ce500e4a3d2..74c8ac0bb9f 100644 --- a/usr.sbin/edquota/edquota.c +++ b/usr.sbin/edquota/edquota.c @@ -42,7 +42,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)edquota.c 8.1 (Berkeley) 6/6/93";*/ -static char *rcsid = "$Id: edquota.c,v 1.30 2002/03/14 16:44:24 mpech Exp $"; +static char *rcsid = "$Id: edquota.c,v 1.31 2002/05/26 09:25:21 deraadt Exp $"; #endif /* not lint */ /* @@ -361,10 +361,11 @@ int editit(tmpfile) char *tmpfile; { - int pid, stat, xpid; + pid_t pid, xpid; char *argp[] = {"sh", "-c", NULL, NULL}; char *ed, *p; sigset_t mask, omask; + int stat; if ((ed = getenv("EDITOR")) == (char *)0) ed = _PATH_VI; diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 83942678bca..0611971dc9e 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inetd.c,v 1.90 2002/05/22 09:09:32 deraadt Exp $ */ +/* $OpenBSD: inetd.c,v 1.91 2002/05/26 09:25:21 deraadt Exp $ */ /* $NetBSD: inetd.c,v 1.11 1996/02/22 11:14:41 mycroft Exp $ */ /* * Copyright (c) 1983,1991 The Regents of the University of California. @@ -41,7 +41,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)inetd.c 5.30 (Berkeley) 6/3/91";*/ -static char rcsid[] = "$OpenBSD: inetd.c,v 1.90 2002/05/22 09:09:32 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: inetd.c,v 1.91 2002/05/26 09:25:21 deraadt Exp $"; #endif /* not lint */ /* @@ -646,8 +646,8 @@ main(argc, argv, envp) sep->se_proto); } if (debug) - fprintf(stderr, "%d execl %s\n", - getpid(), sep->se_server); + fprintf(stderr, "%ld execl %s\n", + (long)getpid(), sep->se_server); dup2(ctrl, 0); close(ctrl); dup2(0, 1); @@ -730,9 +730,9 @@ reap(int sig) void doreap(void) { - pid_t pid; - int status; struct servtab *sep; + int status; + pid_t pid; if (debug) fprintf(stderr, "reaping asked for\n"); @@ -742,7 +742,8 @@ doreap(void) if (pid <= 0) break; if (debug) - fprintf(stderr, "%d reaped, status %x\n", pid, status); + fprintf(stderr, "%ld reaped, status %x\n", + (long)pid, status); for (sep = servtab; sep; sep = sep->se_next) if (sep->se_wait == pid) { if (WIFEXITED(status) && WEXITSTATUS(status)) @@ -1740,7 +1741,7 @@ logpid() FILE *fp; if ((fp = fopen(_PATH_INETDPID, "w")) != NULL) { - fprintf(fp, "%u\n", getpid()); + fprintf(fp, "%ld\n", (long)getpid()); (void)fclose(fp); } } diff --git a/usr.sbin/mopd/mopd/mopd.c b/usr.sbin/mopd/mopd/mopd.c index 1988707b45a..6b4ff52126d 100644 --- a/usr.sbin/mopd/mopd/mopd.c +++ b/usr.sbin/mopd/mopd/mopd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mopd.c,v 1.5 2002/02/16 21:28:04 millert Exp $ */ +/* $OpenBSD: mopd.c,v 1.6 2002/05/26 09:25:21 deraadt Exp $ */ /* * Copyright (c) 1993-96 Mats O Jansson. All rights reserved. @@ -30,7 +30,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: mopd.c,v 1.5 2002/02/16 21:28:04 millert Exp $"; +static char rcsid[] = "$OpenBSD: mopd.c,v 1.6 2002/05/26 09:25:21 deraadt Exp $"; #endif /* @@ -82,8 +82,9 @@ main(argc, argv) int argc; char **argv; { - int c, pid, devnull, f; + int c, devnull, f; char *interface; + pid_t pid; extern int optind; extern char version[]; diff --git a/usr.sbin/pppd/ipxcp.c b/usr.sbin/pppd/ipxcp.c index a5fc1b7b3fa..634c363f64c 100644 --- a/usr.sbin/pppd/ipxcp.c +++ b/usr.sbin/pppd/ipxcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipxcp.c,v 1.7 2002/02/17 19:42:38 millert Exp $ */ +/* $OpenBSD: ipxcp.c,v 1.8 2002/05/26 09:25:21 deraadt Exp $ */ /* * ipxcp.c - PPP IPX Control Protocol. @@ -24,7 +24,7 @@ #if 0 static char rcsid[] = "Id: ipxcp.c,v 1.6 1998/03/25 03:08:16 paulus Exp $"; #else -static char rcsid[] = "$OpenBSD: ipxcp.c,v 1.7 2002/02/17 19:42:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: ipxcp.c,v 1.8 2002/05/26 09:25:21 deraadt Exp $"; #endif #endif @@ -1215,7 +1215,7 @@ ipxcp_script(f, script) char strnetwork[32], strpid[32]; char *argv[14], strproto_lcl[32], strproto_rmt[32]; - sprintf (strpid, "%d", getpid()); + sprintf (strpid, "%ld", (long)getpid()); sprintf (strspeed, "%d", baud_rate); strproto_lcl[0] = '\0'; diff --git a/usr.sbin/pppd/magic.c b/usr.sbin/pppd/magic.c index 0fef78c87e2..f054f397759 100644 --- a/usr.sbin/pppd/magic.c +++ b/usr.sbin/pppd/magic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: magic.c,v 1.5 2002/02/16 21:28:07 millert Exp $ */ +/* $OpenBSD: magic.c,v 1.6 2002/05/26 09:25:21 deraadt Exp $ */ /* * magic.c - PPP Magic Number routines. @@ -23,7 +23,7 @@ #if 0 static char rcsid[] = "Id: magic.c,v 1.7 1998/03/25 03:07:49 paulus Exp $"; #else -static char rcsid[] = "$OpenBSD: magic.c,v 1.5 2002/02/16 21:28:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: magic.c,v 1.6 2002/05/26 09:25:21 deraadt Exp $"; #endif #endif @@ -48,12 +48,14 @@ extern void srand48(long); void magic_init() { +#if 0 long seed; struct timeval t; gettimeofday(&t, NULL); seed = get_host_seed() ^ t.tv_sec ^ t.tv_usec ^ getpid(); srand48(seed); +#endif } /* @@ -62,7 +64,11 @@ magic_init() u_int32_t magic() { +#if 0 return (u_int32_t) mrand48(); +#else + return arc4random(); +#endif } #ifdef NO_DRAND48 diff --git a/usr.sbin/pppd/main.c b/usr.sbin/pppd/main.c index c521b8830ba..b45a9180874 100644 --- a/usr.sbin/pppd/main.c +++ b/usr.sbin/pppd/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.36 2002/05/08 22:30:55 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.37 2002/05/26 09:25:21 deraadt Exp $ */ /* * main.c - Point-to-Point Protocol main module @@ -23,7 +23,7 @@ #if 0 static char rcsid[] = "Id: main.c,v 1.49 1998/05/05 05:24:17 paulus Exp $"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.36 2002/05/08 22:30:55 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.37 2002/05/26 09:25:21 deraadt Exp $"; #endif #endif @@ -640,7 +640,7 @@ create_pidfile() (void) sprintf(pidfilename, "%s%s.pid", _PATH_VARRUN, ifname); if ((pidfile = fopen(pidfilename, "w")) != NULL) { - fprintf(pidfile, "%d\n", pid); + fprintf(pidfile, "%ld\n", (long)pid); (void) fclose(pidfile); } else { syslog(LOG_ERR, "Failed to create pid file %s: %m", pidfilename); @@ -1080,7 +1080,7 @@ device_script(program, in, out) char *program; int in, out; { - int pid; + pid_t pid; int status; int errfd; @@ -1157,7 +1157,7 @@ run_program(prog, args, must_exist) char **args; int must_exist; { - int pid; + pid_t pid; pid = fork(); if (pid == -1) { @@ -1207,7 +1207,7 @@ run_program(prog, args, must_exist) syslog(LOG_WARNING, "Can't execute %s: %m", prog); _exit(1); } - MAINDEBUG((LOG_DEBUG, "Script %s started; pid = %d", prog, pid)); + MAINDEBUG((LOG_DEBUG, "Script %s started; pid = %ld", prog, (long)pid)); ++n_children; return 0; } @@ -1220,7 +1220,8 @@ run_program(prog, args, must_exist) static void reap_kids() { - int pid, status; + int status; + pid_t pid; if (n_children == 0) return; @@ -1232,8 +1233,8 @@ reap_kids() if (pid > 0) { --n_children; if (WIFSIGNALED(status)) { - syslog(LOG_WARNING, "Child process %d terminated with signal %d", - pid, WTERMSIG(status)); + syslog(LOG_WARNING, "Child process %ld terminated with signal %d", + (long)pid, WTERMSIG(status)); } } } diff --git a/usr.sbin/pppd/sys-bsd.c b/usr.sbin/pppd/sys-bsd.c index 8c079afb03d..6c062afdbfb 100644 --- a/usr.sbin/pppd/sys-bsd.c +++ b/usr.sbin/pppd/sys-bsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys-bsd.c,v 1.16 2002/02/16 21:28:07 millert Exp $ */ +/* $OpenBSD: sys-bsd.c,v 1.17 2002/05/26 09:25:21 deraadt Exp $ */ /* * sys-bsd.c - System-dependent procedures for setting up @@ -26,7 +26,7 @@ #if 0 static char rcsid[] = "Id: sys-bsd.c,v 1.31 1998/04/02 12:04:19 paulus Exp $"; #else -static char rcsid[] = "$OpenBSD: sys-bsd.c,v 1.16 2002/02/16 21:28:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: sys-bsd.c,v 1.17 2002/05/26 09:25:21 deraadt Exp $"; #endif #endif @@ -1535,7 +1535,8 @@ lock(dev) char *dev; { char hdb_lock_buffer[12]; - int fd, pid, n; + int fd, n; + pid_t pid; char *p; if ((p = strrchr(dev, '/')) != NULL) @@ -1560,15 +1561,15 @@ lock(dev) /* pid no longer exists - remove the lock file */ if (unlink(lock_file) == 0) { close(fd); - syslog(LOG_NOTICE, "Removed stale lock on %s (pid %d)", - dev, pid); + syslog(LOG_NOTICE, "Removed stale lock on %s (pid %ld)", + dev, (long)pid); continue; } else syslog(LOG_WARNING, "Couldn't remove stale lock on %s", dev); } else - syslog(LOG_NOTICE, "Device %s is locked by pid %d", - dev, pid); + syslog(LOG_NOTICE, "Device %s is locked by pid %ld", + dev, (long)pid); } close(fd); } else @@ -1578,7 +1579,7 @@ lock(dev) return -1; } - sprintf(hdb_lock_buffer, "%10d\n", getpid()); + sprintf(hdb_lock_buffer, "%10ld\n", (long)getpid()); write(fd, hdb_lock_buffer, 11); close(fd); diff --git a/usr.sbin/rarpd/arptab.c b/usr.sbin/rarpd/arptab.c index 2edc7663792..531d964c35d 100644 --- a/usr.sbin/rarpd/arptab.c +++ b/usr.sbin/rarpd/arptab.c @@ -74,7 +74,7 @@ static char sccsid[] = "@(#)arp.c 8.2 (Berkeley) 1/2/94"; #include <syslog.h> #include <string.h> -static int pid; +static pid_t pid; static int s = -1; void diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c index 484c5c0c370..d625267702e 100644 --- a/usr.sbin/rarpd/rarpd.c +++ b/usr.sbin/rarpd/rarpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rarpd.c,v 1.35 2002/03/14 16:44:25 mpech Exp $ */ +/* $OpenBSD: rarpd.c,v 1.36 2002/05/26 09:25:21 deraadt Exp $ */ /* $NetBSD: rarpd.c,v 1.25 1998/04/23 02:48:33 mrg Exp $ */ /* @@ -28,7 +28,7 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char rcsid[] = "$OpenBSD: rarpd.c,v 1.35 2002/03/14 16:44:25 mpech Exp $"; +static char rcsid[] = "$OpenBSD: rarpd.c,v 1.36 2002/05/26 09:25:21 deraadt Exp $"; #endif @@ -118,11 +118,12 @@ main(argc, argv) int argc; char **argv; { - int op, pid, devnull, f; + int op, devnull, f; char *ifname, *hostname; extern char *__progname; extern char *optarg; extern int optind, opterr; + pid_t pid; /* All error reporting is done through syslogs. */ openlog(__progname, LOG_PID | LOG_CONS, LOG_DAEMON); diff --git a/usr.sbin/rpc.pcnfsd/pcnfsd_misc.c b/usr.sbin/rpc.pcnfsd/pcnfsd_misc.c index 93ae185c207..3094ff81de8 100644 --- a/usr.sbin/rpc.pcnfsd/pcnfsd_misc.c +++ b/usr.sbin/rpc.pcnfsd/pcnfsd_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcnfsd_misc.c,v 1.4 2001/08/19 19:16:12 ericj Exp $ */ +/* $OpenBSD: pcnfsd_misc.c,v 1.5 2002/05/26 09:25:22 deraadt Exp $ */ /* $NetBSD: pcnfsd_misc.c,v 1.2 1995/07/25 22:20:42 gwr Exp $ */ /* RE_SID: @(%)/usr/dosnfs/shades_SCCS/unix/pcnfsd/v2/src/SCCS/s.pcnfsd_misc.c 1.5 92/01/24 19:59:13 SMI */ @@ -163,7 +163,7 @@ wlogin(name, req) #define READER_FD 0 #define WRITER_FD 1 -static int child_pid; +static pid_t child_pid; static char cached_user[64] = ""; static uid_t cached_uid; @@ -238,7 +238,8 @@ su_popen(user, cmd, maxtime) int maxtime; { int p[2]; - int parent_fd, child_fd, pid; + int parent_fd, child_fd; + pid_t pid; struct passwd *pw; if (strcmp(cached_user, user)) { @@ -296,14 +297,16 @@ int su_pclose(ptr) FILE *ptr; { - int pid, status; + int status; + pid_t pid; stop_watchdog(); fclose(ptr); if (child_pid == -1) return (-1); - while ((pid = wait(&status)) != child_pid && pid != -1); + while ((pid = wait(&status)) != child_pid && pid != -1) + ; return (pid == -1 ? -1 : status); } diff --git a/usr.sbin/screenblank/screenblank.c b/usr.sbin/screenblank/screenblank.c index 9685c3d4b7d..c2e45365dc3 100644 --- a/usr.sbin/screenblank/screenblank.c +++ b/usr.sbin/screenblank/screenblank.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screenblank.c,v 1.12 2002/02/16 21:28:09 millert Exp $ */ +/* $OpenBSD: screenblank.c,v 1.13 2002/05/26 09:25:22 deraadt Exp $ */ /* $NetBSD: screenblank.c,v 1.2 1996/02/28 01:18:34 thorpej Exp $ */ /*- @@ -342,7 +342,7 @@ logpid() FILE *fp; if ((fp = fopen(_PATH_SCREENBLANKPID, "w")) != NULL) { - fprintf(fp, "%u\n", getpid()); + fprintf(fp, "%ld\n", (long)getpid()); (void)fclose(fp); } } diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index e75647b39fa..c13b527e732 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.50 2002/05/25 13:54:03 fgsch Exp $ */ +/* $OpenBSD: syslogd.c,v 1.51 2002/05/26 09:25:22 deraadt Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94"; #else -static char rcsid[] = "$OpenBSD: syslogd.c,v 1.50 2002/05/25 13:54:03 fgsch Exp $"; +static char rcsid[] = "$OpenBSD: syslogd.c,v 1.51 2002/05/26 09:25:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -354,7 +354,7 @@ main(argc, argv) if (!Debug) { fp = fopen(PidFile, "w"); if (fp != NULL) { - fprintf(fp, "%d\n", getpid()); + fprintf(fp, "%ld\n", (long)getpid()); (void) fclose(fp); } } diff --git a/usr.sbin/wsmoused/wsmoused.c b/usr.sbin/wsmoused/wsmoused.c index b20ef981b3b..db252ea5639 100644 --- a/usr.sbin/wsmoused/wsmoused.c +++ b/usr.sbin/wsmoused/wsmoused.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmoused.c,v 1.11 2002/03/27 18:54:09 jbm Exp $ */ +/* $OpenBSD: wsmoused.c,v 1.12 2002/05/26 09:32:44 deraadt Exp $ */ /* * Copyright (c) 2001 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon @@ -398,7 +398,7 @@ wsmoused(void) background = TRUE; fp = fopen(pidfile, "w"); if (fp != NULL) { - fprintf(fp, "%d\n", getpid()); + fprintf(fp, "%ld\n", (long)getpid()); fclose(fp); } } diff --git a/usr.sbin/ypserv/ypserv/ypserv.c b/usr.sbin/ypserv/ypserv/ypserv.c index cc283d4d5fe..e0073649dca 100644 --- a/usr.sbin/ypserv/ypserv/ypserv.c +++ b/usr.sbin/ypserv/ypserv/ypserv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypserv.c,v 1.21 2002/02/19 19:39:41 millert Exp $ */ +/* $OpenBSD: ypserv.c,v 1.22 2002/05/26 09:32:44 deraadt Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -32,7 +32,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: ypserv.c,v 1.21 2002/02/19 19:39:41 millert Exp $"; +static char rcsid[] = "$OpenBSD: ypserv.c,v 1.22 2002/05/26 09:32:44 deraadt Exp $"; #endif #include <sys/types.h> @@ -454,8 +454,8 @@ main(argc, argv) openlog("ypserv", LOG_PID, LOG_DAEMON); } else { #ifndef RPC_SVC_FG - int size; - int pid, i; + int size, i; + pid_t pid; pid = fork(); if (pid < 0) { |