Deleted Added
full compact
hooks.c (217308) hooks.c (217312)
1/*-
2 * Copyright (c) 2010 The FreeBSD Foundation
3 * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>
4 * All rights reserved.
5 *
6 * This software was developed by Pawel Jakub Dawidek under sponsorship from
7 * the FreeBSD Foundation.
8 *

--- 15 unchanged lines hidden (view full) ---

24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2010 The FreeBSD Foundation
3 * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>
4 * All rights reserved.
5 *
6 * This software was developed by Pawel Jakub Dawidek under sponsorship from
7 * the FreeBSD Foundation.
8 *

--- 15 unchanged lines hidden (view full) ---

24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sbin/hastd/hooks.c 217308 2011-01-12 14:38:17Z pjd $");
32__FBSDID("$FreeBSD: head/sbin/hastd/hooks.c 217312 2011-01-12 16:16:54Z pjd $");
33
34#include <sys/types.h>
35#include <sys/sysctl.h>
36#include <sys/wait.h>
37
38#include <assert.h>
39#include <errno.h>
40#include <fcntl.h>

--- 327 unchanged lines hidden (view full) ---

368 pjdlog_errno(LOG_ERR, "Unable to fork to execute %s", path);
369 hook_free(hp);
370 return;
371 case 0: /* Child. */
372 descriptors();
373 PJDLOG_VERIFY(sigemptyset(&mask) == 0);
374 PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0);
375 /*
33
34#include <sys/types.h>
35#include <sys/sysctl.h>
36#include <sys/wait.h>
37
38#include <assert.h>
39#include <errno.h>
40#include <fcntl.h>

--- 327 unchanged lines hidden (view full) ---

368 pjdlog_errno(LOG_ERR, "Unable to fork to execute %s", path);
369 hook_free(hp);
370 return;
371 case 0: /* Child. */
372 descriptors();
373 PJDLOG_VERIFY(sigemptyset(&mask) == 0);
374 PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0);
375 /*
376 * Dummy handler set for SIGCHLD in the parent should be
377 * changed after fork(2) automatically to the default SIG_IGN,
378 * so there is no need to do anything with it.
376 * Dummy handler set for SIGCHLD in the parent will be restored
377 * to SIG_IGN on execv(3) below, so there is no need to do
378 * anything with it.
379 */
380 execv(path, args);
381 pjdlog_errno(LOG_ERR, "Unable to execute %s", path);
382 exit(EX_SOFTWARE);
383 default: /* Parent. */
384 hook_add(hp, pid);
385 break;
386 }
387}
379 */
380 execv(path, args);
381 pjdlog_errno(LOG_ERR, "Unable to execute %s", path);
382 exit(EX_SOFTWARE);
383 default: /* Parent. */
384 hook_add(hp, pid);
385 break;
386 }
387}