summaryrefslogtreecommitdiff
path: root/lib/libc_r/TEST/test_fcntl.c
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1999-01-10 22:57:12 +0000
committerDavid Leonard <d@cvs.openbsd.org>1999-01-10 22:57:12 +0000
commitdef0d6c22617b70f7bbe487bbd31c9e3a66c48c8 (patch)
treee48e5a13d08fc9b1ed5b03a337ca614f0ca6b1d4 /lib/libc_r/TEST/test_fcntl.c
parent1eab4be7f1cb7dcddac7544d81551ae75fcb70f8 (diff)
nice-ify
Diffstat (limited to 'lib/libc_r/TEST/test_fcntl.c')
-rw-r--r--lib/libc_r/TEST/test_fcntl.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/libc_r/TEST/test_fcntl.c b/lib/libc_r/TEST/test_fcntl.c
index 60bc77ce464..bfe38cb16ec 100644
--- a/lib/libc_r/TEST/test_fcntl.c
+++ b/lib/libc_r/TEST/test_fcntl.c
@@ -1,32 +1,27 @@
#include <stdio.h>
#include <fcntl.h>
+#include "test.h"
main()
{
int flags, child;
- if ((flags = fcntl(0, F_GETFL)) < 0) {
- perror("fcntl 1st GETFL");
- }
- printf ("flags = %x\n", flags);
+ CHECKe(flags = fcntl(0, F_GETFL));
+ printf("flags = %x\n", flags);
- switch(child = fork()) {
- case -1:
- printf("error during fork\n");
- break;
+ CHECKe(child = fork());
+ switch(child) {
case 0: /* child */
- execlp("test_create", "test_create", NULL);
- break;
+ CHECKe(execlp("test_create", "test_create", NULL));
+ /* NOTREACHED */
default: /* parent */
- wait(NULL);
+ CHECKe(wait(NULL));
break;
}
while(1){
- if ((flags = fcntl(0, F_GETFL)) < 0) {
- perror("fcntl parent GETFL");
- }
- printf ("parent %d flags = %x\n", child, flags);
- sleep(1);
+ CHECKe(flags = fcntl(0, F_GETFL));
+ printf ("parent %d flags = %x\n", child, flags);
+ sleep(1);
}
}