diff options
author | neilbrown <neilbrown> | 2006-03-26 23:51:21 +0000 |
---|---|---|
committer | neilbrown <neilbrown> | 2006-03-26 23:51:21 +0000 |
commit | 356c26cc3b8b653618638654d2037719a11d95b6 (patch) | |
tree | 507dbaf8a3bbf5593142795313274b9871e90bf2 /utils/idmapd/idmapd.c | |
parent | 7fa72fa86d16767fcd0c23f21199c943ae7a26ce (diff) | |
download | nfs-utils-356c26cc3b8b653618638654d2037719a11d95b6.tar.gz nfs-utils-356c26cc3b8b653618638654d2037719a11d95b6.tar.xz nfs-utils-356c26cc3b8b653618638654d2037719a11d95b6.zip |
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.
Diffstat (limited to 'utils/idmapd/idmapd.c')
-rw-r--r-- | utils/idmapd/idmapd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c index 73c30b9..69396af 100644 --- a/utils/idmapd/idmapd.c +++ b/utils/idmapd/idmapd.c @@ -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); |