aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-29 18:14:28 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-29 18:14:28 +0100
commit00f100036a70553ee09c345154a00c649d66e54a (patch)
treea2b81ac88219219751d55772068d0c53003668b7
parentm (diff)
downloadsat-00f100036a70553ee09c345154a00c649d66e54a.tar.gz
sat-00f100036a70553ee09c345154a00c649d66e54a.tar.bz2
sat-00f100036a70553ee09c345154a00c649d66e54a.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
-rw-r--r--src/satd-diminished.c17
1 files 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;