commit a15ec49
Fixed conflict.
1 files changed,
+4,
-1
M
httpd.c
M
httpd.c
+4,
-1
1@@ -482,6 +482,7 @@ void httpd(void)
2 int n_threads = 0;
3 int n;
4 time_t start_time = time(NULL);
5+ char sem_name[24];
6
7 address = xs_dict_get(srv_config, "address");
8 port = xs_number_get(xs_dict_get(srv_config, "port"));
9@@ -507,7 +508,8 @@ void httpd(void)
10
11 /* initialize the job control engine */
12 pthread_mutex_init(&job_mutex, NULL);
13- job_sem = sem_open("/job", O_CREAT, 0644, 0);
14+ sprintf(sem_name, "/job_%d", getpid());
15+ job_sem = sem_open(sem_name, O_CREAT, 0644, 0);
16 job_fifo = xs_list_new();
17
18 /* initialize sleep control */
19@@ -567,6 +569,7 @@ void httpd(void)
20 pthread_mutex_unlock(&job_mutex);
21
22 sem_close(job_sem);
23+ sem_unlink(sem_name);
24
25 xs *uptime = xs_str_time_diff(time(NULL) - start_time);
26