Change tabs to whitespaces

This commit is contained in:
Patrick Siegl
2019-03-21 22:04:49 +01:00
parent 47e144eff8
commit ad6c6b3dcb

View File

@@ -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
}