diff --git a/cworker.c b/cworker.c index 357da43..5e8ee27 100644 --- a/cworker.c +++ b/cworker.c @@ -48,7 +48,7 @@ static int mkdirall(const char* path, mode_t mode) { return 0; } -char* last(const char* path) { +char* path_last(const char* path) { char buffer[1024]; size_t psize = strlen(path); strcpy(buffer, path); @@ -68,7 +68,7 @@ char* last(const char* path) { return res; } -char* file(const char* path) { +char* path_file(const char* path) { char buffer[1024]; size_t psize = strlen(path); strcpy(buffer, path); @@ -163,7 +163,6 @@ int cworker_writepid(const cworker_t* worker) { log_error("createing run dir error: %s %s", strerror(errno), srv_runpath); } - int pid_fd = -1; if ((pid_fd = open(srv_runpath, O_WRONLY|O_TRUNC|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP)) < 0) { log_error("open pid file error %s %s", strerror(errno), srv_runpath); @@ -213,6 +212,8 @@ int cworker_detach(const cworker_t* worker) { } if (childpid == 0) { + log_debug("service forkerd"); + return 0; // child } else { // parent