]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Don't close file descriptor until after calling event_del().
authorneilbrown <neilbrown>
Sun, 26 Mar 2006 23:51:21 +0000 (23:51 +0000)
committerneilbrown <neilbrown>
Sun, 26 Mar 2006 23:51:21 +0000 (23:51 +0000)
Delete event processing for a file descriptor before closing it.
This was causing hangs when used in combination with libevent-1.0b.

ChangeLog
utils/idmapd/idmapd.c

index 4836d5f27126b3fde28c248d13e40be122c43849..b24b46cbd61788d275f6eb0f356036c5aa1e0f23 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-27 Kevin Coffman <kwc@citi.umich.edu>
+       Don't close file descriptor until after calling event_del().
+
+       Delete event processing for a file descriptor before closing it.
+       This was causing hangs when used in combination with libevent-1.0b.
+
 2006-03-27 kwc@citi.umich.edu
        Find krb5-config on SuSE 10
 
index 73c30b91c00e07368750823b97cd09f9b34e943e..69396af78fede8448dbfa2438bc0236043b28eba 100644 (file)
@@ -688,10 +688,10 @@ nfsdreopen_one(struct idmap_client *ic)
                idmapd_warnx("ReOpening %s", ic->ic_path);
 
        if ((fd = open(ic->ic_path, O_RDWR, 0)) != -1) {
-               if (ic->ic_fd != -1)
-                       close(ic->ic_fd);
                if ((ic->ic_event.ev_flags & EVLIST_INIT))
                        event_del(&ic->ic_event);
+               if (ic->ic_fd != -1)
+                       close(ic->ic_fd);
 
                ic->ic_event.ev_fd = ic->ic_fd = fd;
                event_set(&ic->ic_event, ic->ic_fd, EV_READ, nfsdcb, ic);