aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/apmd
diff options
context:
space:
mode:
authorMatthew N. Dodd <mdodd@FreeBSD.org>2003-06-22 05:57:34 +0000
committerMatthew N. Dodd <mdodd@FreeBSD.org>2003-06-22 05:57:34 +0000
commit9ad4f2d06711e7c17c75393c2726be55ce1bcf24 (patch)
treea51497214177f198ebf11453d0a8c1156b6bf217 /usr.sbin/apmd
parentc8567c3a772ed3d7b5dcba8bb6e11201c0a6a6b8 (diff)
downloadsrc-9ad4f2d06711e7c17c75393c2726be55ce1bcf24.tar.gz
src-9ad4f2d06711e7c17c75393c2726be55ce1bcf24.zip
Notes
Diffstat (limited to 'usr.sbin/apmd')
-rw-r--r--usr.sbin/apmd/apmd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c
index 88e755c87009..79da66409862 100644
--- a/usr.sbin/apmd/apmd.c
+++ b/usr.sbin/apmd/apmd.c
@@ -120,6 +120,9 @@ event_cmd_exec_act(void *this)
goto out;
case 0:
/* child process */
+ signal(SIGHUP, SIG_DFL);
+ signal(SIGCHLD, SIG_DFL);
+ signal(SIGTERM, SIG_DFL);
execl(_PATH_BSHELL, "sh", "-c", p->line, (char *)NULL);
_exit(127);
default:
@@ -691,10 +694,18 @@ main(int ac, char* av[])
(void) err(1, "cannot open device file `%s'", APM_NORM_DEVICEFILE);
}
+ if (fcntl(apmnorm_fd, F_SETFD, 1) == -1) {
+ (void) err(1, "cannot set close-on-exec flag for device file '%s'", APM_NORM_DEVICEFILE);
+ }
+
if ((apmctl_fd = open(APM_CTL_DEVICEFILE, O_RDWR)) == -1) {
(void) err(1, "cannot open device file `%s'", APM_CTL_DEVICEFILE);
}
+ if (fcntl(apmctl_fd, F_SETFD, 1) == -1) {
+ (void) err(1, "cannot set close-on-exec flag for device file '%s'", APM_CTL_DEVICEFILE);
+ }
+
restart();
write_pid();
event_loop();