Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jul 2014 10:05:53 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r268663 - stable/10/tools/regression/file/flock
Message-ID:  <201407151005.s6FA5roO070381@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Jul 15 10:05:52 2014
New Revision: 268663
URL: http://svnweb.freebsd.org/changeset/base/268663

Log:
  MFC r268385:
  Make this compilable on latest Linux'es without warnings.

Modified:
  stable/10/tools/regression/file/flock/flock.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tools/regression/file/flock/flock.c
==============================================================================
--- stable/10/tools/regression/file/flock/flock.c	Tue Jul 15 10:04:09 2014	(r268662)
+++ stable/10/tools/regression/file/flock/flock.c	Tue Jul 15 10:05:52 2014	(r268663)
@@ -27,6 +27,7 @@
  * $FreeBSD$
  */
 
+#include <sys/file.h>
 #include <sys/time.h>
 #ifdef __FreeBSD__
 #include <sys/mount.h>
@@ -39,6 +40,7 @@
 #include <fcntl.h>
 #include <pthread.h>
 #include <signal.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -51,9 +53,13 @@
 #include <sys/cdefs.h>
 #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 
 	 */
 	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 
 	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");
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407151005.s6FA5roO070381>