static volatile int dir_changed = 1;
-static void dir_notify_handler(int sig, siginfo_t *si, void *data)
+static void dir_notify_handler(int sig)
{
- printerr(2, "dir_notify_handler: sig %d si %p data %p\n", sig, si, data);
+ printerr(2, "dir_notify_handler: sig %d\n", sig);
dir_changed = 1;
}
{
i = clp->gssd_poll_index;
if (i >= 0 && pollarray[i].revents) {
- if (pollarray[i].revents & POLLHUP)
+ if (pollarray[i].revents & POLLHUP) {
+ clp->gssd_close_me = 1;
dir_changed = 1;
+ }
if (pollarray[i].revents & POLLIN)
handle_gssd_upcall(clp);
pollarray[clp->gssd_poll_index].revents = 0;
}
i = clp->krb5_poll_index;
if (i >= 0 && pollarray[i].revents) {
- if (pollarray[i].revents & POLLHUP)
+ if (pollarray[i].revents & POLLHUP) {
+ clp->krb5_close_me = 1;
dir_changed = 1;
+ }
if (pollarray[i].revents & POLLIN)
handle_krb5_upcall(clp);
pollarray[clp->krb5_poll_index].revents = 0;
gssd_run()
{
int ret;
- struct sigaction dn_act;
+ struct sigaction dn_act = {
+ .sa_handler = dir_notify_handler
+ };
sigset_t set;
- /* Taken from linux/Documentation/dnotify.txt: */
- dn_act.sa_sigaction = dir_notify_handler;
sigemptyset(&dn_act.sa_mask);
- dn_act.sa_flags = SA_SIGINFO;
sigaction(DNOTIFY_SIGNAL, &dn_act, NULL);
/* just in case the signal is blocked... */