summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-07-27 23:19:57 +0200
committerLennart Poettering <lennart@poettering.net>2008-07-27 23:19:57 +0200
commit5efbbd686c21ae3386fda751d35d16e7768f7788 (patch)
tree53332a93152da349a4d70d41769d05fc16c3eb61
parent1a91520363539e56cf6098d0b0be04e04d6a4d75 (diff)
rework process logic
-rw-r--r--libasyncns/asyncns.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libasyncns/asyncns.c b/libasyncns/asyncns.c
index 910b76b..2c4a3fd 100644
--- a/libasyncns/asyncns.c
+++ b/libasyncns/asyncns.c
@@ -568,10 +568,9 @@ static int handle_request(int out_fd, const rheader_t *req, size_t length) {
return send_res_reply(out_fd, req->id, (unsigned char *) answer, ret, errno);
}
- case REQUEST_TERMINATE: {
+ case REQUEST_TERMINATE:
/* Quit */
return -1;
- }
default:
;
@@ -585,6 +584,7 @@ static int handle_request(int out_fd, const rheader_t *req, size_t length) {
static int process_worker(int in_fd, int out_fd) {
int have_death_sig = 0;
int good_fds[3];
+ int ret = 1;
const int ignore_sigs[] = {
SIGINT,
@@ -656,7 +656,7 @@ static int process_worker(int in_fd, int out_fd) {
if (!have_death_sig) {
fd_set fds;
- struct timeval tv = { 0, 500000 } ;
+ struct timeval tv = { 0, 500000 };
FD_ZERO(&fds);
FD_SET(in_fd, &fds);
@@ -680,11 +680,13 @@ static int process_worker(int in_fd, int out_fd) {
break;
}
+ ret = 0;
+
fail:
send_died(out_fd);
- return 0;
+ return ret;
}
#else