summaryrefslogtreecommitdiffstats
path: root/tools/regression/lib
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2009-11-12 01:34:55 +0000
committerdes <des@FreeBSD.org>2009-11-12 01:34:55 +0000
commitedcba2a2208a9a63d9a3c0d0390815f6f3690be3 (patch)
treec6fa2300e421cf03c6e9b36b2716ea05b07bc997 /tools/regression/lib
parentdac4404df763635c64ceffd57978fee7b51246b5 (diff)
downloadFreeBSD-src-edcba2a2208a9a63d9a3c0d0390815f6f3690be3.zip
FreeBSD-src-edcba2a2208a9a63d9a3c0d0390815f6f3690be3.tar.gz
Fix warnings and remove one unnecessary use of vfork(). The other could
also be removed with a little more work.
Diffstat (limited to 'tools/regression/lib')
-rw-r--r--tools/regression/lib/libutil/test-flopen.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/regression/lib/libutil/test-flopen.c b/tools/regression/lib/libutil/test-flopen.c
index a3ae35c..0471584 100644
--- a/tools/regression/lib/libutil/test-flopen.c
+++ b/tools/regression/lib/libutil/test-flopen.c
@@ -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);
OpenPOWER on IntegriCloud