projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor
[apps/pfixtools.git]
/
postlicyd.c
diff --git
a/postlicyd.c
b/postlicyd.c
index
bd887e4
..
f6f3ccc
100644
(file)
--- a/
postlicyd.c
+++ b/
postlicyd.c
@@
-89,8
+89,10
@@
void *job_run(void *_fd)
static void main_loop(void)
{
static void main_loop(void)
{
+ int sock = -1;
+
while (!sigint) {
while (!sigint) {
- int fd = accept(
-1
, NULL, 0);
+ int fd = accept(
sock
, NULL, 0);
pthread_attr_t attr;
pthread_t dummy;
pthread_attr_t attr;
pthread_t dummy;
@@
-105,6
+107,9
@@
static void main_loop(void)
pthread_create(&dummy, &attr, job_run, (void *)(intptr_t)fd);
pthread_attr_destroy(&attr);
}
pthread_create(&dummy, &attr, job_run, (void *)(intptr_t)fd);
pthread_attr_destroy(&attr);
}
+
+ cleanexit = true;
+ close(sock);
}
static void main_shutdown(void)
}
static void main_shutdown(void)
@@
-122,7
+127,6
@@
int main(void)
main_initialize();
main_loop();
main_initialize();
main_loop();
- cleanexit = true;
main_shutdown();
return EXIT_SUCCESS;
}
main_shutdown();
return EXIT_SUCCESS;
}