summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'httpd.c')
-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)
482 int n_threads = 0; 482 int n_threads = 0;
483 int n; 483 int n;
484 time_t start_time = time(NULL); 484 time_t start_time = time(NULL);
485 char sem_name[24];
485 486
486 address = xs_dict_get(srv_config, "address"); 487 address = xs_dict_get(srv_config, "address");
487 port = xs_number_get(xs_dict_get(srv_config, "port")); 488 port = xs_number_get(xs_dict_get(srv_config, "port"));
@@ -507,7 +508,8 @@ void httpd(void)
507 508
508 /* initialize the job control engine */ 509 /* initialize the job control engine */
509 pthread_mutex_init(&job_mutex, NULL); 510 pthread_mutex_init(&job_mutex, NULL);
510 job_sem = sem_open("/job", O_CREAT, 0644, 0); 511 sprintf(sem_name, "/job_%d", getpid());
512 job_sem = sem_open(sem_name, O_CREAT, 0644, 0);
511 job_fifo = xs_list_new(); 513 job_fifo = xs_list_new();
512 514
513 /* initialize sleep control */ 515 /* initialize sleep control */
@@ -567,6 +569,7 @@ void httpd(void)
567 pthread_mutex_unlock(&job_mutex); 569 pthread_mutex_unlock(&job_mutex);
568 570
569 sem_close(job_sem); 571 sem_close(job_sem);
572 sem_unlink(sem_name);
570 573
571 xs *uptime = xs_str_time_diff(time(NULL) - start_time); 574 xs *uptime = xs_str_time_diff(time(NULL) - start_time);
572 575