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) {
+ for (;;) {
int option;
int seconds;
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);
}
}
- while (1) {
+ for (;;) {
struct stat statbuf;
const struct timespec duration = { 0 , 1000 * 1000 * 1000 / LOOP_PER_SECOND };