]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/gssd/gssd_main_loop.c
gssd: unblock DNOTIFY_SIGNAL in case it was blocked.
[nfs-utils.git] / utils / gssd / gssd_main_loop.c
index a086bb398ca1d2ecc6d866ca9d91456c1e7383e9..b9f3a06520265c02f7ec5a14b1367d30297141c3 100644 (file)
@@ -99,6 +99,7 @@ gssd_run()
        int                     ret;
        struct sigaction        dn_act;
        int                     fd;
+       sigset_t                set;
 
        /* Taken from linux/Documentation/dnotify.txt: */
        dn_act.sa_sigaction = dir_notify_handler;
@@ -106,9 +107,14 @@ gssd_run()
        dn_act.sa_flags = SA_SIGINFO;
        sigaction(DNOTIFY_SIGNAL, &dn_act, NULL);
 
-       if ((fd = open(pipefsdir, O_RDONLY)) == -1) {
+       /* just in case the signal is blocked... */
+       sigemptyset(&set);
+       sigaddset(&set, DNOTIFY_SIGNAL);
+       sigprocmask(SIG_UNBLOCK, &set, NULL);
+
+       if ((fd = open(pipefs_nfsdir, O_RDONLY)) == -1) {
                printerr(0, "ERROR: failed to open %s: %s\n",
-                        pipefsdir, strerror(errno));
+                        pipefs_nfsdir, strerror(errno));
                exit(1);
        }
        fcntl(fd, F_SETSIG, DNOTIFY_SIGNAL);
@@ -116,6 +122,7 @@ gssd_run()
 
        init_client_list();
 
+       printerr(1, "beginning poll\n");
        while (1) {
                while (dir_changed) {
                        dir_changed = 0;