diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2014-03-14 16:03:55 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2014-03-14 16:03:55 +0000 |
commit | 095755402f5775cde9e9eac61d031eb78be0e3cd (patch) | |
tree | eaf1600aacb11c79838df324e6855040100fc081 /usr.sbin/nsd/server.c | |
parent | 484d8522231c1b7bacc638b0b84d502e4231886a (diff) |
merge conflicts
Diffstat (limited to 'usr.sbin/nsd/server.c')
-rw-r--r-- | usr.sbin/nsd/server.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/nsd/server.c b/usr.sbin/nsd/server.c index f2188257b18..b208f7b1fb8 100644 --- a/usr.sbin/nsd/server.c +++ b/usr.sbin/nsd/server.c @@ -1498,6 +1498,16 @@ server_main(struct nsd *nsd) } fsync(reload_listener.fd); close(reload_listener.fd); + /* wait for reload to finish processing */ + while(1) { + if(waitpid(reload_pid, NULL, 0) == -1) { + if(errno == EINTR) continue; + if(errno == ECHILD) break; + log_msg(LOG_ERR, "waitpid(reload %d): %s", + (int)reload_pid, strerror(errno)); + } + break; + } } if(nsd->xfrd_listener->fd != -1) { /* complete quit, stop xfrd */ @@ -1512,11 +1522,13 @@ server_main(struct nsd *nsd) close(nsd->xfrd_listener->fd); (void)kill(nsd->pid, SIGTERM); } - xfrd_del_tempdir(nsd); #if 0 /* OS collects memory pages */ region_destroy(server_region); #endif + /* write the nsd.db to disk, wait for it to complete */ + udb_base_sync(nsd->db->udb, 1); + udb_base_close(nsd->db->udb); server_shutdown(nsd); } |