summaryrefslogtreecommitdiff
path: root/source3/nmbd/asyncdns.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nmbd/asyncdns.c')
-rw-r--r--source3/nmbd/asyncdns.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/source3/nmbd/asyncdns.c b/source3/nmbd/asyncdns.c
index 3b71369d67..3fb16a08e9 100644
--- a/source3/nmbd/asyncdns.c
+++ b/source3/nmbd/asyncdns.c
@@ -103,7 +103,8 @@ static void asyncdns_process(void)
}
/**************************************************************************** **
- catch a sigterm
+ catch a sigterm (in the child process - the parent has a different handler
+ see nmbd.c for details).
We need a separate term handler here so we don't release any
names that our parent is going to release, or overwrite a
WINS db that our parent is going to write.
@@ -117,6 +118,17 @@ static int sig_term()
}
/***************************************************************************
+ Called by the parent process when it receives a SIGTERM - also kills the
+ child so we don't get child async dns processes lying around, causing trouble.
+ ****************************************************************************/
+
+void kill_async_dns_child()
+{
+ if(child_pid != 0 && child_pid != -1)
+ kill(child_pid, SIGTERM);
+}
+
+/***************************************************************************
create a child process to handle DNS lookups
****************************************************************************/
void start_async_dns(void)
@@ -326,4 +338,12 @@ BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
send_wins_name_query_response(0, p, *n);
return False;
}
+
+/***************************************************************************
+ With sync dns there is no child to kill on SIGTERM.
+ ****************************************************************************/
+void kill_async_dns_child()
+{
+ return;
+}
#endif