diff --git a/src/lib/cache.c b/src/lib/cache.c index 2abc1b9..a0a6188 100644 --- a/src/lib/cache.c +++ b/src/lib/cache.c @@ -214,20 +214,18 @@ int cache_init() { if (pid == 0) { // child if (cache_process() == 0) { - return 1; + return 0; } else { return -6; } } else if (pid > 0) { // parent fprintf(stderr, "Started child process with PID %i as cache-updater\n", pid); - children[0] = pid; + return pid; } else { fprintf(stderr, ERR_STR "Unable to create child process: %s" CLR_STR "\n", strerror(errno)); return -5; } - - return 0; } int cache_unload() { diff --git a/src/necronda-server.c b/src/necronda-server.c index 8ea9015..2017e1b 100644 --- a/src/necronda-server.c +++ b/src/necronda-server.c @@ -323,6 +323,8 @@ int main(int argc, const char *argv[]) { config_unload(); return 1; } else if (ret != 0) { + children[0] = ret; // pid + } else { return 0; }