summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/gen/syslog.c4
-rw-r--r--lib/libc/stdlib/system.c6
-rw-r--r--lib/libutil/pidfile.c6
-rw-r--r--lib/libutil/uucplock.c8
-rw-r--r--lib/libwrap/update.c6
5 files changed, 15 insertions, 15 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);