summaryrefslogtreecommitdiff
path: root/sbin/dhcpleased/dhcpleased.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/dhcpleased/dhcpleased.c')
-rw-r--r--sbin/dhcpleased/dhcpleased.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sbin/dhcpleased/dhcpleased.c b/sbin/dhcpleased/dhcpleased.c
index ef6200d6bc0..cc9d98995d2 100644
--- a/sbin/dhcpleased/dhcpleased.c
+++ b/sbin/dhcpleased/dhcpleased.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcpleased.c,v 1.26 2022/07/23 09:33:18 florian Exp $ */
+/* $OpenBSD: dhcpleased.c,v 1.27 2022/11/27 15:19:38 kn Exp $ */
/*
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -221,8 +221,11 @@ main(int argc, char *argv[])
errx(1, "need root privileges");
lockfd = open(_PATH_LOCKFILE, O_CREAT|O_RDWR|O_EXLOCK|O_NONBLOCK, 0600);
- if (lockfd == -1)
- errx(1, "already running");
+ if (lockfd == -1) {
+ if (errno == EAGAIN)
+ errx(1, "already running");
+ err(1, "%s", _PATH_LOCKFILE);
+ }
/* Check for assigned daemon user */
if (getpwnam(DHCPLEASED_USER) == NULL)