From caf3a68af9e698f30a28e37e9851180c4efeda89 Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 15 Jul 2014 10:05:52 +0000 Subject: MFC r268385: Make this compilable on latest Linux'es without warnings. --- tools/regression/file/flock/flock.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tools/regression') diff --git a/tools/regression/file/flock/flock.c b/tools/regression/file/flock/flock.c index c411853..fd426b0 100644 --- a/tools/regression/file/flock/flock.c +++ b/tools/regression/file/flock/flock.c @@ -27,6 +27,7 @@ * $FreeBSD$ */ +#include #include #ifdef __FreeBSD__ #include @@ -39,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -51,9 +53,13 @@ #include #else #ifndef __unused +#ifdef __GNUC__ +#define __unused __attribute__((__unused__)) +#else #define __unused #endif #endif +#endif int verbose = 0; @@ -1329,7 +1335,6 @@ test15(int fd, __unused int argc, const __unused char **argv) */ int pid; int pfd[2]; - int fd2; struct flock fl; char ch; int res; @@ -1366,7 +1371,7 @@ test15(int fd, __unused int argc, const __unused char **argv) if (read(pfd[0], &ch, 1) != 1) err(1, "reading from pipe (child)"); - fd2 = dup(fd); + (void)dup(fd); if (flock(fd, LOCK_SH) < 0) err(1, "flock shared"); -- cgit v1.1