const char *action;
const char *subsystem;
struct sigaction act;
+ sigset_t mask;
int err = -EINVAL;
udev = udev_new();
sigaction(SIGALRM, &act, NULL);
sigaction(SIGINT, &act, NULL);
sigaction(SIGTERM, &act, NULL);
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGALRM);
+ sigaddset(&mask, SIGINT);
+ sigaddset(&mask, SIGTERM);
+ sigprocmask(SIG_UNBLOCK, &mask, NULL);
/* trigger timeout to prevent hanging processes */
alarm(UDEV_EVENT_TIMEOUT);
int udevadm_monitor(struct udev *udev, int argc, char *argv[])
{
struct sigaction act;
+ sigset_t mask;
int option;
int prop = 0;
int print_kernel = 0;
act.sa_flags = SA_RESTART;
sigaction(SIGINT, &act, NULL);
sigaction(SIGTERM, &act, NULL);
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGINT);
+ sigaddset(&mask, SIGTERM);
+ sigprocmask(SIG_UNBLOCK, &mask, NULL);
printf("monitor will print the received events for:\n");
if (print_udev) {
const char *exists = NULL;
int timeout = DEFAULT_TIMEOUT;
struct sigaction act;
+ sigset_t mask;
struct udev_queue *udev_queue = NULL;
int rc = 1;
act.sa_flags = 0;
sigaction(SIGALRM, &act, NULL);
sigaction(SIGUSR1, &act, NULL);
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGUSR1);
+ sigaddset(&mask, SIGALRM);
+ sigprocmask(SIG_UNBLOCK, &mask, NULL);
while (1) {
int option;
uctrl = udev_ctrl_new_from_socket(udev, UDEV_CTRL_SOCK_PATH);
if (uctrl != NULL) {
- sigset_t mask, oldmask;
+ sigset_t oldmask;
sigemptyset(&mask);
sigaddset(&mask, SIGUSR1);