-/* $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>
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)
-/* $OpenBSD: resolvd.c,v 1.29 2022/11/14 13:57:46 kn Exp $ */
+/* $OpenBSD: resolvd.c,v 1.30 2022/11/27 15:19:38 kn Exp $ */
/*
* Copyright (c) 2021 Florian Obser <florian@openbsd.org>
* Copyright (c) 2021 Theo de Raadt <deraadt@openbsd.org>
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);
+ }
if (!debug)
daemon(0, 0);
-/* $OpenBSD: slaacd.c,v 1.66 2022/09/15 07:59:59 florian Exp $ */
+/* $OpenBSD: slaacd.c,v 1.67 2022/11/27 15:19:38 kn Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
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(SLAACD_USER) == NULL)