From a09e49f3f45386d7e12fce56724f1336a97207d6 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Fri, 3 Feb 2017 11:27:00 -0800 Subject: [PATCH] [v9_11] silence "unused value" warning (cherry picked from commit f4d20b15a2ae52aac9ea8316e546abb61e22ae39) --- lib/isc/unix/dir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/isc/unix/dir.c b/lib/isc/unix/dir.c index 29a587ac2c..d43e5ced01 100644 --- a/lib/isc/unix/dir.c +++ b/lib/isc/unix/dir.c @@ -160,6 +160,9 @@ isc_dir_chdir(const char *dirname) { isc_result_t isc_dir_chroot(const char *dirname) { +#ifdef HAVE_CHROOT + void *tmp; +#endif REQUIRE(dirname != NULL); @@ -170,7 +173,9 @@ isc_dir_chroot(const char *dirname) { * may fail to load library in chroot. * Do not report errors if it fails, we do not need any result now. */ - getprotobyname("udp") && getservbyname("domain", "udp"); + tmp = getprotobyname("udp"); + if (tmp != NULL) + (void) getservbyname("domain", "udp"); if (chroot(dirname) < 0 || chdir("/") < 0) return (isc__errno2result(errno));