From: Neil Brown <neilb@suse.de>
To: "Czarnowska, Anna" <anna.czarnowska@intel.com>
Cc: "linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
"Neubauer, Wojciech" <Wojciech.Neubauer@intel.com>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"Ciechanowski, Ed" <ed.ciechanowski@intel.com>,
"Hawrylewicz Czarnowski,
Przemyslaw" <przemyslaw.hawrylewicz.czarnowski@intel.com>,
"Labun, Marcin" <Marcin.Labun@intel.com>
Subject: Re: [PATCH] fix: Monitor doesn't return after starting daemon
Date: Wed, 15 Dec 2010 08:58:14 +1100 [thread overview]
Message-ID: <20101215085814.6a04b9af@notabene.brown> (raw)
In-Reply-To: <A9DE54D0CD747C4CB06DCE5B6FA2246F010E44C3EC@irsmsx504.ger.corp.intel.com>
On Tue, 14 Dec 2010 14:47:27 +0000 "Czarnowska, Anna"
<anna.czarnowska@intel.com> wrote:
> >From 8b2465b0d314cc93bba5797dbad9fd2813f0a79e Mon Sep 17 00:00:00 2001
> From: Anna Czarnowska <anna.czarnowska@intel.com>
> Date: Tue, 14 Dec 2010 12:26:33 +0100
> Subject: [PATCH] fix: Monitor doesn't return after starting daemon
> Cc: linux-raid@vger.kernel.org, Williams, Dan J <dan.j.williams@intel.com>, Ciechanowski, Ed <ed.ciechanowski@intel.com>
>
> Because both parent and child process continue after make_daemon succeeds.
Applied, thanks.
NeilBrown
>
> Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
> ---
> Monitor.c | 10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/Monitor.c b/Monitor.c
> index e7f6d03..4ae1d2b 100644
> --- a/Monitor.c
> +++ b/Monitor.c
> @@ -152,9 +152,11 @@ int Monitor(struct mddev_dev *devlist,
> info.mailfrom = mailfrom;
> info.dosyslog = dosyslog;
>
> - if (daemonise)
> - if (make_daemon(pidfile))
> - return 1;
> + if (daemonise) {
> + int rv = make_daemon(pidfile);
> + if (rv >= 0)
> + return rv;
> + }
>
> if (share)
> if (check_one_sharer(scan))
> @@ -272,7 +274,7 @@ static int make_daemon(char *pidfile)
> dup2(0,1);
> dup2(0,2);
> setsid();
> - return 0;
> + return -1;
> }
>
> static int check_one_sharer(int scan)
prev parent reply other threads:[~2010-12-14 21:58 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-29 14:13 [Patch 00/17] Autorebuild Czarnowska, Anna
2010-11-17 10:22 ` Neil Brown
2010-11-17 16:04 ` Labun, Marcin
2010-11-18 23:14 ` Czarnowska, Anna
2010-11-19 12:43 ` Devel 3.2 branch issues Czarnowska, Anna
2010-11-22 3:29 ` Neil Brown
2010-11-22 17:18 ` Labun, Marcin
2010-11-22 18:47 ` Dan Williams
2010-11-23 17:34 ` Labun, Marcin
2010-11-19 15:12 ` Autorebuild, new dynamic udev rules for hot-plugs Hawrylewicz Czarnowski, Przemyslaw
2010-11-22 5:02 ` Neil Brown
2010-11-22 23:50 ` Hawrylewicz Czarnowski, Przemyslaw
2010-11-23 0:11 ` Dan Williams
2010-11-23 1:17 ` Neil Brown
2010-11-23 5:04 ` Dan Williams
2010-11-23 5:27 ` Neil Brown
2010-11-23 6:17 ` Dan Williams
2010-11-23 17:01 ` Hawrylewicz Czarnowski, Przemyslaw
2010-12-23 15:44 ` Hawrylewicz Czarnowski, Przemyslaw
2010-11-22 2:16 ` [Patch 00/17] Autorebuild Neil Brown
2010-11-22 15:08 ` Czarnowska, Anna
2010-11-23 1:34 ` Neil Brown
2010-11-23 18:20 ` Labun, Marcin
2010-12-09 11:40 ` Czarnowska, Anna
2010-12-13 0:21 ` Neil Brown
2010-12-14 14:47 ` [PATCH] fix: Monitor doesn't return after starting daemon Czarnowska, Anna
2010-12-14 21:58 ` Neil Brown [this message]
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=20101215085814.6a04b9af@notabene.brown \
--to=neilb@suse.de \
--cc=Marcin.Labun@intel.com \
--cc=Wojciech.Neubauer@intel.com \
--cc=anna.czarnowska@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ed.ciechanowski@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=przemyslaw.hawrylewicz.czarnowski@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).