From 00f100036a70553ee09c345154a00c649d66e54a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 29 Dec 2015 18:14:28 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/satd-diminished.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/satd-diminished.c b/src/satd-diminished.c index 41cb54a..e2ba0b9 100644 --- a/src/satd-diminished.c +++ b/src/satd-diminished.c @@ -31,9 +31,12 @@ /** - * The common beginning of for all daemon pathnames. + * Macro that adds the common beginning of for + * all daemon pathnames to a string literal. + * + * @param name:string literal The unique part of the pathname. */ -#define DAEMON_PREFIX LIBEXECDIR "/" PACKAGE "/satd-" +#define DAEMON_IMAGE(name) LIBEXECDIR "/" PACKAGE "/satd-" name @@ -84,10 +87,10 @@ fork_again: goto fork_again; case 0: switch (command) { - case SAT_QUEUE: image = DAEMON_PREFIX "add"; break; - case SAT_REMOVE: image = DAEMON_PREFIX "rm"; break; - case SAT_PRINT: image = DAEMON_PREFIX "list"; break; - case SAT_RUN: image = DAEMON_PREFIX "run"; break; + case SAT_QUEUE: image = DAEMON_IMAGE("add"); break; + case SAT_REMOVE: image = DAEMON_IMAGE("rm"); break; + case SAT_PRINT: image = DAEMON_IMAGE("list"); break; + case SAT_RUN: image = DAEMON_IMAGE("run"); break; default: fprintf(stderr, "%s: invalid command received.\n", argv[0]); goto child_fail; @@ -127,7 +130,7 @@ main(int argc, char *argv[], char *envp[]) /* The magnificent loop. */ accept_again: if (received_signo == SIGHUP) { - execve(DAEMON_PREFIX "diminished", argv, envp); + execve(DAEMON_IMAGE("diminished"), argv, envp); perror(argv[0]); } received_signo = 0; -- cgit v1.2.3-70-g09d2