summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-03-08 19:28:48 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-03-08 19:28:48 +0000
commitb8fd8d26d265ed4d343887b806d6a41cbb2817eb (patch)
tree025a83d4b698cef7d5daa80268039be04797a0ce
parent692d89bb85ce43b9405351da51559452de852302 (diff)
warning cleanups; ok guenther
-rw-r--r--regress/sys/kern/getpeereid/getpeereid_test.c6
-rw-r--r--regress/sys/kern/nanosleep/nanosleep.c4
-rw-r--r--regress/sys/kern/unixsock/unixsock_test.c12
3 files changed, 11 insertions, 11 deletions
diff --git a/regress/sys/kern/getpeereid/getpeereid_test.c b/regress/sys/kern/getpeereid/getpeereid_test.c
index 820ff2bcbca..8363d33143b 100644
--- a/regress/sys/kern/getpeereid/getpeereid_test.c
+++ b/regress/sys/kern/getpeereid/getpeereid_test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getpeereid_test.c,v 1.3 2015/01/19 00:22:30 guenther Exp $ */
+/* $OpenBSD: getpeereid_test.c,v 1.4 2017/03/08 19:28:47 deraadt Exp $ */
/* Written by Marc Espie in 2006 */
/* Public domain */
#include <sys/types.h>
@@ -61,7 +61,7 @@ client(struct sockaddr_un *sun)
if (r == 0) {
problem = check_id(s);
if (problem)
- errx(1, problem);
+ errx(1, "%s", problem);
exit(0);
}
sleep(5);
@@ -101,7 +101,7 @@ server(struct sockaddr_un *sun)
if (problem) {
unlink(path);
rmdir(dir);
- errx(1, problem);
+ errx(1, "%s", problem);
}
unlink(path);
rmdir(dir);
diff --git a/regress/sys/kern/nanosleep/nanosleep.c b/regress/sys/kern/nanosleep/nanosleep.c
index d44100ab090..fad3ec88459 100644
--- a/regress/sys/kern/nanosleep/nanosleep.c
+++ b/regress/sys/kern/nanosleep/nanosleep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nanosleep.c,v 1.5 2003/08/02 01:24:36 david Exp $ */
+/* $OpenBSD: nanosleep.c,v 1.6 2017/03/08 19:28:47 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -79,7 +79,7 @@ trivial(void)
* If we receive any signal, something is wrong anyway.
*/
if (rts.tv_sec != 0 || rts.tv_nsec != 0) {
- warnx("trivial: non-zero time? %d/%d", rts.tv_sec,
+ warnx("trivial: non-zero time? %lld/%ld", (long long)rts.tv_sec,
rts.tv_nsec);
return 1;
}
diff --git a/regress/sys/kern/unixsock/unixsock_test.c b/regress/sys/kern/unixsock/unixsock_test.c
index 6ed1b0ef1bc..decbfa92086 100644
--- a/regress/sys/kern/unixsock/unixsock_test.c
+++ b/regress/sys/kern/unixsock/unixsock_test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unixsock_test.c,v 1.2 2011/07/06 06:22:59 guenther Exp $ */
+/* $OpenBSD: unixsock_test.c,v 1.3 2017/03/08 19:28:47 deraadt Exp $ */
/* Written by Claudio Jeker in 2011 */
/* Public domain */
#include <sys/types.h>
@@ -104,9 +104,9 @@ main()
sun2.sun_family = AF_UNIX;
snprintf(sun->sun_path, sizeof(ss) - 2, "%s.%.*s", path,
- slen - strlen(path) - 1, aaa);
+ (int)(slen - strlen(path) - 1), aaa);
snprintf(sun2.sun_path, sizeof(sun2) - 2, "%s.%.*s", "socket",
- slen - strlen(path) - 1, aaa);
+ (int)(slen - strlen(path) - 1), aaa);
if (test_bind(sun, slen + 2) != t[i].r) {
warn("FAIL: bind(\"%s\") len %d", sun->sun_path,
@@ -120,14 +120,14 @@ main()
}
if (sizeof(*sun) >= slen + 2 &&
test_bind(sun, sizeof(*sun)) != t[i].r) {
- warn("FAIL3: bind(\"%s\") len %d", sun->sun_path,
+ warn("FAIL3: bind(\"%s\") len %zd", sun->sun_path,
sizeof(*sun));
fail = 1;
}
sun->sun_path[slen] = 'a';
if (test_bind(sun, slen + 2) != t[i].r) {
warn("FAIL4: bind(\"%.*s\") len %d no-NUL",
- slen + 2, sun->sun_path, slen + 2);
+ (int)(slen + 2), sun->sun_path, slen + 2);
fail = 1;
}
sun->sun_path[slen] = '\0';
@@ -144,7 +144,7 @@ main()
}
if (sizeof(*sun) >= slen + 2 &&
test_connect(sun, sizeof(*sun), &sun2) != t[i].r) {
- warn("FAIL3: connect(\"%s\") len %d", sun->sun_path,
+ warn("FAIL3: connect(\"%s\") len %zd", sun->sun_path,
sizeof(*sun));
fail = 1;
}