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 E2A56138CC5 for ; Tue, 24 Mar 2015 20:40:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 86B16E0901; Tue, 24 Mar 2015 20:40:09 +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 3E7BCE0901 for ; Tue, 24 Mar 2015 20:40:09 +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 F31D534083A for ; Tue, 24 Mar 2015 20:40:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 845C01474E for ; Tue, 24 Mar 2015 20:40:03 +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: <1427229347.d7a09327f76e94226ee324a6e70cf415aa96cf89.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: d7a09327f76e94226ee324a6e70cf415aa96cf89 X-VCS-Branch: master Date: Tue, 24 Mar 2015 20:40:03 +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: 59f60ecd-43d4-4939-b780-fdf2a54cdc7a X-Archives-Hash: 07553c3af7212a55545b97c3b69084f1 commit: d7a09327f76e94226ee324a6e70cf415aa96cf89 Author: Will Miles sgl com> AuthorDate: Fri Mar 13 16:34:29 2015 +0000 Commit: William Hubbs gentoo org> CommitDate: Tue Mar 24 20:35:47 2015 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=d7a09327 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)