From 58f99c3acdb5b0c434065dba4dee4d98c223a72e Mon Sep 17 00:00:00 2001 From: Oleg Borodin Date: Wed, 16 Aug 2023 09:20:55 +0200 Subject: [PATCH] at work --- cworker.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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