diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2016-07-20 11:08:29 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2016-07-20 11:12:10 -0400 |
commit | d4b2d066b0dac218fbd1471492b7575d55a413e5 (patch) | |
tree | c69de347fb7b2b4f2b1e5fefe2a08e94ce873914 | |
parent | 6e79a74d7936fc1d1bbe20e2a7abd6def40c00ea (diff) | |
download | nfs-utils-d4b2d066b0dac218fbd1471492b7575d55a413e5.tar.gz nfs-utils-d4b2d066b0dac218fbd1471492b7575d55a413e5.tar.xz nfs-utils-d4b2d066b0dac218fbd1471492b7575d55a413e5.zip |
blkmapd: unlink pid file when error out
Fix some error out without unlink pid file.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/blkmapd/device-discovery.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c index 50e2746..8eb3fd0 100644 --- a/utils/blkmapd/device-discovery.c +++ b/utils/blkmapd/device-discovery.c @@ -486,13 +486,13 @@ int main(int argc, char **argv) signal(SIGHUP, SIG_IGN); if (dflag) { - bl_discover_devices(); - exit(0); + ret = bl_discover_devices(); + goto out; } if ((bl_watch_fd = inotify_init()) < 0) { BL_LOG_ERR("init inotify failed %s\n", strerror(errno)); - exit(1); + goto out; } /* open pipe file */ @@ -513,7 +513,7 @@ int main(int argc, char **argv) BL_LOG_ERR("inquiry process return %d\n", ret); } } - +out: if (pidfd >= 0) { close(pidfd); unlink(PID_FILE); |