Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Nov 2009 01:34:55 +0000 (UTC)
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r199212 - head/tools/regression/lib/libutil
Message-ID:  <200911120134.nAC1YtCn013922@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
-#include <sys/signal.h>
 #include <sys/types.h>
 #include <sys/fcntl.h>
 
 #include <errno.h>
+#include <signal.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -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);



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