summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2008-05-25 16:49:05 +0000
committerJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2008-05-25 16:49:05 +0000
commitb233c3a1ff6b091ece3665b0d7c385128fd1ab7a (patch)
treec883acfa5326842b64a4be0c27eb7675736f1484
parentacf20edd5663502b0bc3faa8d42af1084c6a9b62 (diff)
- chat to syslog if the script file can't be read or executed.
ok otto@
-rw-r--r--usr.sbin/hotplugd/hotplugd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/hotplugd/hotplugd.c b/usr.sbin/hotplugd/hotplugd.c
index 546372e686e..bd6c1627ee8 100644
--- a/usr.sbin/hotplugd/hotplugd.c
+++ b/usr.sbin/hotplugd/hotplugd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hotplugd.c,v 1.8 2008/05/12 19:15:02 pyr Exp $ */
+/* $OpenBSD: hotplugd.c,v 1.9 2008/05/25 16:49:04 jasper Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -141,9 +141,10 @@ exec_script(const char *file, int class, char *name)
snprintf(strclass, sizeof(strclass), "%d", class);
- if (access(file, X_OK | R_OK))
- /* do nothing if file can't be accessed */
+ if (access(file, X_OK | R_OK)) {
+ syslog(LOG_ERR, "could not access %s", file);
return;
+ }
if ((pid = fork()) == -1) {
syslog(LOG_ERR, "fork: %m");