summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-05-09 17:22:31 +0200
committerdefault <nobody@localhost>2023-05-09 17:22:31 +0200
commita15ec49a1d4c47d91c8455ad486b5e62f0cdfd11 (patch)
treebb768cab5cffb235e96d747df3d163149bc200c6
parent28720d4a9dae311e60addf4d174425d26e32ef42 (diff)
parentd91150997c9a37462913124f8e453894d4d7dae8 (diff)
Fixed conflict.
-rw-r--r--httpd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/httpd.c b/httpd.c
index a86142d..841ad4c 100644
--- a/httpd.c
+++ b/httpd.c
@@ -482,6 +482,7 @@ void httpd(void)
int n_threads = 0;
int n;
time_t start_time = time(NULL);
+ char sem_name[24];
address = xs_dict_get(srv_config, "address");
port = xs_number_get(xs_dict_get(srv_config, "port"));
@@ -507,7 +508,8 @@ void httpd(void)
/* initialize the job control engine */
pthread_mutex_init(&job_mutex, NULL);
- job_sem = sem_open("/job", O_CREAT, 0644, 0);
+ sprintf(sem_name, "/job_%d", getpid());
+ job_sem = sem_open(sem_name, O_CREAT, 0644, 0);
job_fifo = xs_list_new();
/* initialize sleep control */
@@ -567,6 +569,7 @@ void httpd(void)
pthread_mutex_unlock(&job_mutex);
sem_close(job_sem);
+ sem_unlink(sem_name);
xs *uptime = xs_str_time_diff(time(NULL) - start_time);