summaryrefslogtreecommitdiff
path: root/usr.sbin/apmd
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2013-04-29 00:28:24 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2013-04-29 00:28:24 +0000
commit893b957ab23fe3eb2386c9acedd396606f76b5cb (patch)
treeef352fdb5afd940f9c19549bb1e8a4986357e87b /usr.sbin/apmd
parent8656f10462f9b7ede2d214dc09969c2fa153b626 (diff)
use FD_CLOEXEC instead of 1; from David Hill
ok otto
Diffstat (limited to 'usr.sbin/apmd')
-rw-r--r--usr.sbin/apmd/apmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c
index 6ddb2cfbfd3..1c157584ff1 100644
--- a/usr.sbin/apmd/apmd.c
+++ b/usr.sbin/apmd/apmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apmd.c,v 1.58 2012/03/26 20:17:45 deraadt Exp $ */
+/* $OpenBSD: apmd.c,v 1.59 2013/04/29 00:28:23 okan Exp $ */
/*
* Copyright (c) 1995, 1996 John T. Kohl
@@ -594,12 +594,12 @@ main(int argc, char *argv[])
if ((ctl_fd = open(fname, O_RDWR)) == -1) {
if (errno != ENXIO && errno != ENOENT)
error("cannot open device file `%s'", fname);
- } else if (fcntl(ctl_fd, F_SETFD, 1) == -1)
+ } else if (fcntl(ctl_fd, F_SETFD, FD_CLOEXEC) == -1)
error("cannot set close-on-exec for `%s'", fname);
sock_fd = bind_socket(sockname);
- if (fcntl(sock_fd, F_SETFD, 1) == -1)
+ if (fcntl(sock_fd, F_SETFD, FD_CLOEXEC) == -1)
error("cannot set close-on-exec for the socket", NULL);
power_status(ctl_fd, 1, &pinfo);