From ad6c6b3dcb173b82616954a575d3199678605f62 Mon Sep 17 00:00:00 2001 From: Patrick Siegl Date: Thu, 21 Mar 2019 22:04:49 +0100 Subject: [PATCH] Change tabs to whitespaces --- software/daemon.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/software/daemon.c b/software/daemon.c index 4ef6afd..1c106e3 100644 --- a/software/daemon.c +++ b/software/daemon.c @@ -22,26 +22,26 @@ static bool writePid(int32_t pid, char *fileName) { } void startDaemon(struct opt_struct* opts) { - if(!opts->daemon) { - // No backgrounding, optionslly write current PID - if(opts->pidFileName != NULL) { - writePid(getpid(), opts->pidFileName); - } - return; - } - int32_t pid = fork(); - if(pid < 0) { - fputs("fork() failed\n", stderr); - exit(1); - } else if(pid > 0) { - // Parent - if(opts->pidFileName != NULL) { - if(!writePid(pid, opts->pidFileName)) { - exit(1); - } - } - exit(0); - } - // Child + if(!opts->daemon) { + // No backgrounding, optionslly write current PID + if(opts->pidFileName != NULL) { + writePid(getpid(), opts->pidFileName); + } + return; + } + int32_t pid = fork(); + if(pid < 0) { + fputs("fork() failed\n", stderr); + exit(1); + } else if(pid > 0) { + // Parent + if(opts->pidFileName != NULL) { + if(!writePid(pid, opts->pidFileName)) { + exit(1); + } + } + exit(0); + } + // Child }