diff options
Diffstat (limited to 'libunbound/libunbound.c')
-rw-r--r-- | libunbound/libunbound.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libunbound/libunbound.c b/libunbound/libunbound.c index b3a4c2ba77f6..7c2509ba8d50 100644 --- a/libunbound/libunbound.c +++ b/libunbound/libunbound.c @@ -65,6 +65,9 @@ #ifdef HAVE_PTHREAD #include <signal.h> #endif +#ifdef HAVE_SYS_WAIT_H +#include <sys/wait.h> +#endif #if defined(UB_ON_WINDOWS) && defined (HAVE_WINDOWS_H) #include <windows.h> @@ -218,6 +221,12 @@ static void ub_stop_bg(struct ub_ctx* ctx) ub_thread_join(ctx->bg_tid); } else { lock_basic_unlock(&ctx->cfglock); +#ifndef UB_ON_WINDOWS + if(waitpid(ctx->bg_pid, NULL, 0) == -1) { + if(verbosity > 2) + log_err("waitpid: %s", strerror(errno)); + } +#endif } } else { @@ -946,7 +955,7 @@ ub_ctx_resolvconf(struct ub_ctx* ctx, const char* fname) while (ptr) { numserv++; if((retval=ub_ctx_set_fwd(ctx, - ptr->IpAddress.String)!=0)) { + ptr->IpAddress.String))!=0) { free(info); return retval; } |