public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/
Date: Wed, 29 Nov 2017 22:10:44 +0000 (UTC)	[thread overview]
Message-ID: <1511992422.97a254f599db622d34a0c1bbd3057d1a7050a468.williamh@OpenRC> (raw)

commit:     97a254f599db622d34a0c1bbd3057d1a7050a468
Author:     Doug Freed <dwfreed <AT> mtu <DOT> edu>
AuthorDate: Wed Nov 29 20:10:39 2017 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Wed Nov 29 21:53:42 2017 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=97a254f5

start-stop-daemon: properly handle missing pidfile

X-Gentoo-Bug: 639218
X-Gentoo-Bug-URL: https://bugs.gentoo.org/639218

 src/rc/start-stop-daemon.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index e98f8ba3..54b89b2a 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -657,8 +657,15 @@ int main(int argc, char **argv)
 			parse_schedule(applet, "0", sig);
 		else
 			parse_schedule(applet, NULL, sig);
+		if (pidfile) {
+			pid = get_pid(applet, pidfile);
+			if (pid == -1)
+				exit(EXIT_FAILURE);
+		} else {
+			pid = 0;
+		}
 		i = run_stop_schedule(applet, exec, (const char *const *)margv,
-		    get_pid(applet, pidfile), uid, test, progress, false);
+		    pid, uid, test, progress, false);
 
 		if (i < 0)
 			/* We failed to stop something */


             reply	other threads:[~2017-11-29 22:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 22:10 William Hubbs [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-11-27 19:09 [gentoo-commits] proj/openrc:0.34.x commit in: src/rc/ William Hubbs
2017-11-20 17:56 William Hubbs
2017-11-07 21:39 William Hubbs
2017-11-07 21:39 William Hubbs
2017-10-28  0:29 William Hubbs
2017-10-28  0:29 William Hubbs
2017-10-26 19:19 William Hubbs
2017-10-26 19:01 William Hubbs
2017-10-26 19:01 William Hubbs
2017-10-26 19:01 William Hubbs

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=1511992422.97a254f599db622d34a0c1bbd3057d1a7050a468.williamh@OpenRC \
    --to=williamh@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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