signals.c
author viric@llimona
Fri, 13 Apr 2007 20:52:28 +0200
changeset 127 c620eacd7630
parent 102 27b0f0e44de8
child 138 00461b7bdf4b
permissions -rw-r--r--
Fixed the versions in the code.

/*
    Task Spooler - a task queue system for the unix user
    Copyright (C) 2007  LluĂ­s Batlle i Rossell

    Please find the license in the provided COPYING file.
*/
#include <signal.h>
#include <stdlib.h> /* for NULL */

/* Some externs refer to this variable */
static sigset_t normal_sigmask;

void ignore_sigpipe()
{
    sigset_t set;

    sigemptyset(&set);
    sigaddset(&set, SIGPIPE);
    sigprocmask(SIG_BLOCK, &set, &normal_sigmask);
}

void restore_sigmask()
{
    sigprocmask(SIG_SETMASK, &normal_sigmask, NULL);
}