[Reproducible-commits] [dpkg] 36/74: s-s-d: Simplify action dispatching in main()

Mattia Rizzolo mattia at debian.org
Sun Jul 3 22:22:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to annotated tag 1.18.8
in repository dpkg.

commit 038a6e0832a5f8a89b8a1cf251e6517600912efd
Author: Guillem Jover <guillem at debian.org>
Date:   Mon May 30 20:40:14 2016 +0200

    s-s-d: Simplify action dispatching in main()
    
    Avoid useless intermediate variables, and use if else to select the
    actions.
---
 utils/start-stop-daemon.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index c04811a..ec8fe3b 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -2346,18 +2346,10 @@ main(int argc, char **argv)
 
 	if (action == ACTION_START)
 		return do_start(argc, argv);
-
-	if (action == ACTION_STOP) {
-		int i = run_stop_schedule();
-		exit(i);
-	}
-
-	if (action == ACTION_STATUS) {
-		enum status_code prog_status;
-
-		prog_status = do_findprocs();
-		exit(prog_status);
-	}
+	else if (action == ACTION_STOP)
+		return run_stop_schedule();
+	else if (action == ACTION_STATUS)
+		return do_findprocs();
 
 	return 0;
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list