diff options
Diffstat (limited to 'src/daemon/daemon.c')
-rw-r--r-- | src/daemon/daemon.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index 8003b806..ef6ffe9b 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c | |||
@@ -276,7 +276,7 @@ MHD_create_connection(struct MHD_Daemon * daemon) { | |||
276 | 276 | ||
277 | daemon->connections[first_free]->id = first_free; | 277 | daemon->connections[first_free]->id = first_free; |
278 | daemon->connections[first_free]->daemon = daemon; | 278 | daemon->connections[first_free]->daemon = daemon; |
279 | daemon->connections[first_free]->pid = NULL; | 279 | daemon->connections[first_free]->pid = (pthread_t)-1; |
280 | daemon->connections[first_free]->bufPos = 0; | 280 | daemon->connections[first_free]->bufPos = 0; |
281 | daemon->connections[first_free]->messagePos= 0; | 281 | daemon->connections[first_free]->messagePos= 0; |
282 | daemon->connections[first_free]->responsePending = 0; | 282 | daemon->connections[first_free]->responsePending = 0; |
@@ -1384,7 +1384,7 @@ MHD_start_daemon(unsigned int options, | |||
1384 | retVal->dh = dh; | 1384 | retVal->dh = dh; |
1385 | retVal->dh_cls = dh_cls; | 1385 | retVal->dh_cls = dh_cls; |
1386 | retVal->shutdown = 0; | 1386 | retVal->shutdown = 0; |
1387 | retVal->pid = NULL; | 1387 | retVal->pid = (pthread_t)-1; |
1388 | 1388 | ||
1389 | retVal->firstFreeHandler = 0; | 1389 | retVal->firstFreeHandler = 0; |
1390 | for(i = 0; i < MHD_MAX_HANDLERS; i++) { | 1390 | for(i = 0; i < MHD_MAX_HANDLERS; i++) { |
@@ -1475,13 +1475,13 @@ MHD_stop_daemon(struct MHD_Daemon * daemon) { | |||
1475 | 1475 | ||
1476 | daemon->shutdown = 1; | 1476 | daemon->shutdown = 1; |
1477 | 1477 | ||
1478 | if(daemon->pid != NULL) { | 1478 | if(daemon->pid != (pthread_t)-1) { |
1479 | pthread_join(daemon->pid, NULL); | 1479 | pthread_join(daemon->pid, NULL); |
1480 | } | 1480 | } |
1481 | 1481 | ||
1482 | for(i = 0; i < MHD_MAX_CONNECTIONS; i++) { | 1482 | for(i = 0; i < MHD_MAX_CONNECTIONS; i++) { |
1483 | if(daemon->connections[i] != NULL) { | 1483 | if(daemon->connections[i] != NULL) { |
1484 | if(daemon->connections[i]->pid != NULL) { | 1484 | if(daemon->connections[i]->pid != (pthread_t)-1) { |
1485 | pthread_join(daemon->connections[i]->pid, NULL); | 1485 | pthread_join(daemon->connections[i]->pid, NULL); |
1486 | } | 1486 | } |
1487 | 1487 | ||