X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fgssd%2Fgssd_main_loop.c;h=397fd1461f3c873077ecbd7c2f78548bf8b0ea9e;hb=99ed8de8261beb580c0ab9543ea7f2c8e16c9306;hp=a086bb398ca1d2ecc6d866ca9d91456c1e7383e9;hpb=f1bfe0916c04d93de7a4fae5315fff6e4ccac23f;p=nfs-utils.git diff --git a/utils/gssd/gssd_main_loop.c b/utils/gssd/gssd_main_loop.c index a086bb3..397fd14 100644 --- a/utils/gssd/gssd_main_loop.c +++ b/utils/gssd/gssd_main_loop.c @@ -28,9 +28,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ + #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif + #include #include #include @@ -99,6 +104,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 +112,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,12 +127,12 @@ gssd_run() init_client_list(); + printerr(1, "beginning poll\n"); while (1) { while (dir_changed) { dir_changed = 0; if (update_client_list()) { - printerr(0, "ERROR: couldn't update " - "client list\n"); + /* Error msg is already printed */ exit(1); } }