diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-07-05 07:25:28 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-07-05 07:25:28 +0000 |
commit | 7d73f7651de9982c3fa7e72dcea6465300edbbf1 (patch) | |
tree | f72fc3ee012865ed01fe6db08edbc714af3a60f4 /usr.bin/rdist | |
parent | 982e43a92518875f6eb7d2c97822d247873bc350 (diff) |
Assume POSIX: sigrocmask()
Properly use SIG_SIGMASK to restore previous mask
Diffstat (limited to 'usr.bin/rdist')
-rw-r--r-- | usr.bin/rdist/child.c | 18 | ||||
-rw-r--r-- | usr.bin/rdist/os-openbsd.h | 3 |
2 files changed, 5 insertions, 16 deletions
diff --git a/usr.bin/rdist/child.c b/usr.bin/rdist/child.c index 72e55d41335..dd1deea4f2f 100644 --- a/usr.bin/rdist/child.c +++ b/usr.bin/rdist/child.c @@ -1,4 +1,4 @@ -/* $OpenBSD: child.c,v 1.21 2014/07/05 06:35:03 guenther Exp $ */ +/* $OpenBSD: child.c,v 1.22 2014/07/05 07:25:27 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -96,28 +96,18 @@ removechild(CHILD *child) /* * Remove the child */ -#if defined(POSIX_SIGNALS) - sigset_t set; + sigset_t set, oset; sigemptyset(&set); sigaddset(&set, SIGCHLD); - sigprocmask(SIG_BLOCK, &set, NULL); -#else /* !POSIX_SIGNALS */ - int oldmask; - - oldmask = sigblock(sigmask(SIGCHLD)); -#endif /* POSIX_SIGNALS */ + sigprocmask(SIG_BLOCK, &set, &oset); if (prevpc != NULL) prevpc->c_next = pc->c_next; else childlist = pc->c_next; -#if defined(POSIX_SIGNALS) - sigprocmask(SIG_UNBLOCK, &set, NULL); -#else - sigsetmask(oldmask); -#endif /* POSIX_SIGNALS */ + sigprocmask(SIG_SETMASK, &oset, NULL); (void) free(child->c_name); --activechildren; diff --git a/usr.bin/rdist/os-openbsd.h b/usr.bin/rdist/os-openbsd.h index b67aa50b110..5ddef01ffa5 100644 --- a/usr.bin/rdist/os-openbsd.h +++ b/usr.bin/rdist/os-openbsd.h @@ -29,7 +29,7 @@ */ /* - * $OpenBSD: os-openbsd.h,v 1.19 2014/07/05 07:22:18 guenther Exp $ + * $OpenBSD: os-openbsd.h,v 1.20 2014/07/05 07:25:27 guenther Exp $ */ /* @@ -74,7 +74,6 @@ * Things we have */ #define HAVE_VIS /* Have vis() */ -#define POSIX_SIGNALS /* Have POSIX signals */ #define HAVE_PATHS_H /* Have <paths.h> */ /* |