]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
manager: remove ask-password fd from sd_event before closing it
authorLennart Poettering <lennart@poettering.net>
Sun, 30 Aug 2015 20:13:55 +0000 (22:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 31 Aug 2015 11:20:44 +0000 (13:20 +0200)
Otherwise we might attempt to remove a non-existing fd from epoll.

src/core/manager.c

index ecea89c377a6145bb6764766469371a8303f3bb9..ede2a9910dae5e71e611c552efa8fa68706db2eb 100644 (file)
@@ -250,8 +250,8 @@ static int manager_dispatch_ask_password_fd(sd_event_source *source,
 static void manager_close_ask_password(Manager *m) {
         assert(m);
 
-        m->ask_password_inotify_fd = safe_close(m->ask_password_inotify_fd);
         m->ask_password_event_source = sd_event_source_unref(m->ask_password_event_source);
+        m->ask_password_inotify_fd = safe_close(m->ask_password_inotify_fd);
         m->have_ask_password = -EINVAL;
 }