]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/gssd/gssd_main_loop.c
rpc.gssd: close upcall pipe on POLLHUP
[nfs-utils.git] / utils / gssd / gssd_main_loop.c
index b5117c57cc2f3e5f7856d1b42924628bf297cdf6..c18e12c37c60cba220424c47ee1cafb0e8adb00c 100644 (file)
@@ -63,6 +63,8 @@ static volatile int dir_changed = 1;
 
 static void dir_notify_handler(int sig, siginfo_t *si, void *data)
 {
+       printerr(2, "dir_notify_handler: sig %d si %p data %p\n", sig, si, data);
+
        dir_changed = 1;
 }
 
@@ -74,24 +76,28 @@ scan_poll_results(int ret)
 
        for (clp = clnt_list.tqh_first; clp != NULL; clp = clp->list.tqe_next)
        {
-               i = clp->krb5_poll_index;
+               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_krb5_upcall(clp);
-                       pollarray[clp->krb5_poll_index].revents = 0;
+                               handle_gssd_upcall(clp);
+                       pollarray[clp->gssd_poll_index].revents = 0;
                        ret--;
                        if (!ret)
                                break;
                }
-               i = clp->spkm3_poll_index;
+               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_spkm3_upcall(clp);
-                       pollarray[clp->spkm3_poll_index].revents = 0;
+                               handle_krb5_upcall(clp);
+                       pollarray[clp->krb5_poll_index].revents = 0;
                        ret--;
                        if (!ret)
                                break;