From owner-svn-src-head@FreeBSD.ORG Thu Nov 12 01:34:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A094B106566B; Thu, 12 Nov 2009 01:34:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F7E58FC12; Thu, 12 Nov 2009 01:34:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAC1Ytxt013924; Thu, 12 Nov 2009 01:34:55 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAC1YtCn013922; Thu, 12 Nov 2009 01:34:55 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200911120134.nAC1YtCn013922@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 12 Nov 2009 01:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199212 - head/tools/regression/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 12 Nov 2009 01:34:55 -0000 Author: des Date: Thu Nov 12 01:34:55 2009 New Revision: 199212 URL: http://svn.freebsd.org/changeset/base/199212 Log: Fix warnings and remove one unnecessary use of vfork(). The other could also be removed with a little more work. Modified: head/tools/regression/lib/libutil/test-flopen.c Modified: head/tools/regression/lib/libutil/test-flopen.c ============================================================================== --- head/tools/regression/lib/libutil/test-flopen.c Thu Nov 12 01:33:57 2009 (r199211) +++ head/tools/regression/lib/libutil/test-flopen.c Thu Nov 12 01:34:55 2009 (r199212) @@ -28,11 +28,11 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include +#include #include #include #include @@ -169,16 +169,10 @@ test_flopen_lock_child(void) _exit(0); } close(fd1); - fd2 = -42; - if (vfork() == 0) { - fd2 = flopen(fn, O_RDWR|O_NONBLOCK); + if ((fd2 = flopen(fn, O_RDWR|O_NONBLOCK)) != -1) { + result = "second open succeeded"; close(fd2); - _exit(0); } - if (fd2 == -42) - result = "vfork() doesn't work as expected"; - if (fd2 >= 0) - result = "second open succeeded"; kill(pid, SIGINT); } unlink(fn);