diff options
author | Roman Rakus <rrakus@redhat.com> | 2013-07-01 13:55:58 +0200 |
---|---|---|
committer | Roman Rakus <rrakus@redhat.com> | 2013-07-03 13:44:02 +0200 |
commit | 0f424bf9162bf0a3b3cf47f321c0aec5a3cfe7bc (patch) | |
tree | 42834d47b3ed9e30149bd2127542c46a9669d758 /src/account | |
parent | fec0c7b1f97c74ca89ff1c63557354a044db71c7 (diff) | |
download | openlmi-providers-0f424bf9162bf0a3b3cf47f321c0aec5a3cfe7bc.tar.gz openlmi-providers-0f424bf9162bf0a3b3cf47f321c0aec5a3cfe7bc.tar.xz openlmi-providers-0f424bf9162bf0a3b3cf47f321c0aec5a3cfe7bc.zip |
Account: Remove dead code
Signed-off-by: Roman Rakus <rrakus@redhat.com>
Diffstat (limited to 'src/account')
-rw-r--r-- | src/account/indication_common.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/account/indication_common.c b/src/account/indication_common.c index 5f3c47e..aedf864 100644 --- a/src/account/indication_common.c +++ b/src/account/indication_common.c @@ -111,8 +111,7 @@ static int timecmp(struct timespec a, struct timespec b) (wd) = inotify_add_watch((fd), (file), IN_CLOSE_WRITE | IN_MODIFY |\ IN_DELETE | IN_DELETE_SELF);\ if ((wd) < 0) {\ - close((fd));\ - return false;\ + goto bail;\ }\ bool watcher(void *data) @@ -129,10 +128,6 @@ bool watcher(void *data) int wd_pwd, wd_grp; ADD_WATCH(fd, wd_pwd, PASSWD_FILE); ADD_WATCH(fd, wd_grp, GROUP_FILE); - if (wd_pwd < 0 || wd_grp < 0) { - close(fd); - return false; - } do { int len = 0, i = 0; @@ -180,4 +175,13 @@ out: inotify_rm_watch(fd, wd_grp); close(fd); return true; +bail: + if (wd_pwd > 0) { + inotify_rm_watch(fd, wd_pwd); + } + if (wd_grp > 0) { + inotify_rm_watch(fd, wd_grp); + } + close(fd); + return false; } |