From 4a6714894c506c1f4be0031dbc08662fca6a240c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 23 Apr 2009 09:04:38 +0100 Subject: Register inotify watch only if setup succeeds --- plugins/loopback.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/loopback.c') diff --git a/plugins/loopback.c b/plugins/loopback.c index 04bd7a1c..deaaac27 100644 --- a/plugins/loopback.c +++ b/plugins/loopback.c @@ -101,9 +101,6 @@ static int create_watch(void) return -EIO; } - g_io_add_watch(inotify_channel, G_IO_IN | G_IO_ERR | G_IO_HUP, - inotify_event, NULL); - hostname_descriptor = inotify_add_watch(fd, "/etc/hostname", IN_MODIFY | IN_DELETE_SELF | IN_MOVE_SELF); if (hostname_descriptor < 0) { @@ -114,6 +111,9 @@ static int create_watch(void) return -EIO; } + g_io_add_watch(inotify_channel, G_IO_IN | G_IO_ERR | G_IO_HUP, + inotify_event, NULL); + return 0; } -- cgit v1.2.3