From owner-svn-src-head@FreeBSD.ORG Tue Jul 8 08:11:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA77D67E; Tue, 8 Jul 2014 08:11:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C826027E0; Tue, 8 Jul 2014 08:11:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s688BqEu019099; Tue, 8 Jul 2014 08:11:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s688Bq6Z019098; Tue, 8 Jul 2014 08:11:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407080811.s688Bq6Z019098@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 8 Jul 2014 08:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268385 - head/tools/regression/file/flock X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 08:11:52 -0000 Author: kib Date: Tue Jul 8 08:11:52 2014 New Revision: 268385 URL: http://svnweb.freebsd.org/changeset/base/268385 Log: Make this compilable on latest Linux'es without warnings. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/tools/regression/file/flock/flock.c Modified: head/tools/regression/file/flock/flock.c ============================================================================== --- head/tools/regression/file/flock/flock.c Tue Jul 8 08:10:15 2014 (r268384) +++ head/tools/regression/file/flock/flock.c Tue Jul 8 08:11:52 2014 (r268385) @@ -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 */ 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");