summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-03-24 21:52:51 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-03-24 21:52:51 +0100
commit3070107b5e7ca68839b4fed9c9080615f2e5b06b (patch)
tree8ca9b8976de868ee0aa3d00a53780d09d1311f3a /src
parent38d14ec4d7ec62ff29fa5636d3462c3ae297e917 (diff)
downloadabrt-3070107b5e7ca68839b4fed9c9080615f2e5b06b.tar.gz
abrt-3070107b5e7ca68839b4fed9c9080615f2e5b06b.tar.xz
abrt-3070107b5e7ca68839b4fed9c9080615f2e5b06b.zip
abrt-gui: tweak inotify code
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui-gtk/main.c18
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 */