From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 7D5BE138CC5 for ; Tue, 24 Mar 2015 20:53:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F1C9BE0903; Tue, 24 Mar 2015 20:53:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9DE12E0903 for ; Tue, 24 Mar 2015 20:53:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 68316340A16 for ; Tue, 24 Mar 2015 20:53:38 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D026A14742 for ; Tue, 24 Mar 2015 20:53:34 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1427230339.c1faafcad8197a821282b8e56a10132e27eb5d9f.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/start-stop-daemon.c X-VCS-Directories: src/rc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: c1faafcad8197a821282b8e56a10132e27eb5d9f X-VCS-Branch: master Date: Tue, 24 Mar 2015 20:53:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: e41444dd-966c-4fda-8373-e4d43d230ae1 X-Archives-Hash: b9eeb880eca42b6c682552433949f81e commit: c1faafcad8197a821282b8e56a10132e27eb5d9f Author: Will Miles sgl com> AuthorDate: Fri Mar 13 16:34:29 2015 +0000 Commit: William Hubbs gentoo org> CommitDate: Tue Mar 24 20:52:19 2015 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=c1faafca start-stop-daemon: Fix regression for --test The previous fix to --test (PR #34) prevented reading one too many arguments when --exec -or --name was not specified, but created a regression where the last argument would not print if either of those arguments was specified. This corrects the issue. Fixes #41. src/rc/start-stop-daemon.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c index 3afbf2e..7919835 100644 --- a/src/rc/start-stop-daemon.c +++ b/src/rc/start-stop-daemon.c @@ -919,10 +919,13 @@ start_stop_daemon(int argc, char **argv) exec = name; if (name && start) *argv = name; - } else if (name) + } else if (name) { *--argv = name; - else if (exec) + ++argc; + } else if (exec) { *--argv = exec; + ++argc; + }; if (stop || sig != -1) { if (sig == -1)