This commit is contained in:
2023-08-16 09:20:55 +02:00
parent e7e9e20410
commit 58f99c3acd

View File

@@ -48,7 +48,7 @@ static int mkdirall(const char* path, mode_t mode) {
return 0; return 0;
} }
char* last(const char* path) { char* path_last(const char* path) {
char buffer[1024]; char buffer[1024];
size_t psize = strlen(path); size_t psize = strlen(path);
strcpy(buffer, path); strcpy(buffer, path);
@@ -68,7 +68,7 @@ char* last(const char* path) {
return res; return res;
} }
char* file(const char* path) { char* path_file(const char* path) {
char buffer[1024]; char buffer[1024];
size_t psize = strlen(path); size_t psize = strlen(path);
strcpy(buffer, 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); log_error("createing run dir error: %s %s", strerror(errno), srv_runpath);
} }
int pid_fd = -1; int pid_fd = -1;
if ((pid_fd = open(srv_runpath, O_WRONLY|O_TRUNC|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP)) < 0) { 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); 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) { if (childpid == 0) {
log_debug("service forkerd");
return 0;
// child // child
} else { } else {
// parent // parent