summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2010-08-20 06:56:53 +0000
committerratchov <ratchov@openbsd.org>2010-08-20 06:56:53 +0000
commitd3029f245a5a905d061ea6e267b92a18adeae536 (patch)
tree867c9d800e7a509c7a571a4108bc8d09e845b328
parentwhite space fix (diff)
downloadwireguard-openbsd-d3029f245a5a905d061ea6e267b92a18adeae536.tar.xz
wireguard-openbsd-d3029f245a5a905d061ea6e267b92a18adeae536.zip
polish the code: remove few unused #includes, add missing ones,
fix NULL vs 0, etc. No behaviour change.
-rw-r--r--lib/libsndio/sndio.c7
-rw-r--r--usr.bin/aucat/aucat.c5
-rw-r--r--usr.bin/aucat/file.c6
3 files changed, 11 insertions, 7 deletions
diff --git a/lib/libsndio/sndio.c b/lib/libsndio/sndio.c
index 8f7e4b9e08c..075e1779534 100644
--- a/lib/libsndio/sndio.c
+++ b/lib/libsndio/sndio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sndio.c,v 1.25 2010/04/24 06:15:54 ratchov Exp $ */
+/* $OpenBSD: sndio.c,v 1.26 2010/08/20 06:56:53 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -197,7 +197,10 @@ sio_open(const char *str, unsigned mode, int nbio)
minor(sb.st_rdev) & 0xf);
} else
strlcpy(buf, "0", sizeof(buf));
- return sio_open_sun(buf, mode, nbio);
+ hdl = sio_open_sun(buf, mode, nbio);
+ if (hdl != NULL)
+ return hdl;
+ return NULL;
}
sep = strchr(str, ':');
if (sep == NULL) {
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c
index 37ef703d0d3..256e4291e32 100644
--- a/usr.bin/aucat/aucat.c
+++ b/usr.bin/aucat/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.103 2010/08/19 06:31:06 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.104 2010/08/20 06:56:54 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -30,7 +30,6 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <varargs.h>
#include "abuf.h"
#include "aparams.h"
@@ -181,7 +180,7 @@ opt_mode(void)
char *p = optarg;
size_t len;
- for (p = optarg; *p != NULL; p++) {
+ for (p = optarg; *p != '\0'; p++) {
len = strcspn(p, ",");
if (strncmp("play", p, len) == 0) {
mode |= MODE_PLAY;
diff --git a/usr.bin/aucat/file.c b/usr.bin/aucat/file.c
index e1eefa8d8ae..d19a6685e38 100644
--- a/usr.bin/aucat/file.c
+++ b/usr.bin/aucat/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.21 2010/07/10 12:32:45 ratchov Exp $ */
+/* $OpenBSD: file.c,v 1.22 2010/08/20 06:56:54 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -46,6 +46,7 @@
*
*/
+#include <sys/time.h>
#include <sys/types.h>
#include <err.h>
@@ -55,6 +56,7 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
+#include <time.h>
#include "abuf.h"
#include "aproc.h"
@@ -357,7 +359,7 @@ file_poll(void)
}
}
f = LIST_FIRST(&file_list);
- while (f != LIST_END(&file_list)) {
+ while (f != NULL) {
if (f->pfd == NULL) {
f = LIST_NEXT(f, entry);
continue;