summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-07-27 10:42:25 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-07-27 10:42:25 +0000
commit35ad6375cdaf55db054683da214d8bbcea149b72 (patch)
tree00f97e8dc91aca06775474213a5d1045ec5e5858
parent56f4d825714ca92ff62cb8025c191078db59b42f (diff)
fcntl(F_DUPFD) needs an argument. Otherwise it fails with EINVAL
when compiled with clang.
-rw-r--r--regress/sys/kern/fcntl_dup/fcntl_dup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regress/sys/kern/fcntl_dup/fcntl_dup.c b/regress/sys/kern/fcntl_dup/fcntl_dup.c
index 88469c611f9..0f16ba7a8c0 100644
--- a/regress/sys/kern/fcntl_dup/fcntl_dup.c
+++ b/regress/sys/kern/fcntl_dup/fcntl_dup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fcntl_dup.c,v 1.2 2003/07/31 21:48:08 deraadt Exp $ */
+/* $OpenBSD: fcntl_dup.c,v 1.3 2017/07/27 10:42:24 bluhm Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -28,7 +28,7 @@ main(int argc, char *argv[])
if (fcntl(fd1, F_SETFD, 1) != 0)
err(1, "fcntl(F_SETFD)");
- if ((fd2 = fcntl(fd1, F_DUPFD)) < 0)
+ if ((fd2 = fcntl(fd1, F_DUPFD, 0)) < 0)
err(1, "fcntl(F_DUPFD)");
/* Test 2: Was close-on-exec cleared? */