diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-03-24 21:52:51 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-03-24 21:52:51 +0100 |
commit | 3070107b5e7ca68839b4fed9c9080615f2e5b06b (patch) | |
tree | 8ca9b8976de868ee0aa3d00a53780d09d1311f3a | |
parent | 38d14ec4d7ec62ff29fa5636d3462c3ae297e917 (diff) | |
download | abrt-3070107b5e7ca68839b4fed9c9080615f2e5b06b.tar.gz abrt-3070107b5e7ca68839b4fed9c9080615f2e5b06b.tar.xz abrt-3070107b5e7ca68839b4fed9c9080615f2e5b06b.zip |
abrt-gui: tweak inotify code
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r-- | src/gui-gtk/main.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c index 10a15af4..652d1882 100644 --- a/src/gui-gtk/main.c +++ b/src/gui-gtk/main.c @@ -55,13 +55,17 @@ static void init_notify(void) static void close_notify(void) { - //VERB1 log("g_source_remove:"); - g_source_remove(channel_inotify_event_id); - //VERB1 log("g_io_channel_unref:"); - g_io_channel_unref(channel_inotify); - //VERB1 log("close(inotify_fd):"); - close(inotify_fd); - //VERB1 log("Done"); + if (inotify_fd >= 0) + { + //VERB1 log("g_source_remove:"); + g_source_remove(channel_inotify_event_id); + //VERB1 log("g_io_channel_unref:"); + g_io_channel_unref(channel_inotify); + //VERB1 log("close(inotify_fd):"); + close(inotify_fd); + inotify_fd = -1; + //VERB1 log("Done"); + } } /* Inotify handler */ |