From: Kinglong Mee <kinglongmee@gmail.com>
To: Steve Dickson <SteveD@redhat.com>
Cc: linux-nfs@vger.kernel.org, Kinglong Mee <kinglongmee@gmail.com>
Subject: [PATCH 2/2] blkmapd: unlink pid file when error out
Date: Thu, 14 Jul 2016 10:51:22 +0800 [thread overview]
Message-ID: <90d4ca22-1ec0-3cba-263f-7a3cdd871b28@gmail.com> (raw)
Fix some error out without unlink pid file.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
utils/blkmapd/device-discovery.c | 8 ++++----
1 file 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);
--
2.7.4
next reply other threads:[~2016-07-14 2:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 2:51 Kinglong Mee [this message]
2016-07-20 15:14 ` [PATCH 2/2] blkmapd: unlink pid file when error out Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=90d4ca22-1ec0-3cba-263f-7a3cdd871b28@gmail.com \
--to=kinglongmee@gmail.com \
--cc=SteveD@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox