From: Mark Andrews Date: Wed, 4 Mar 2015 02:49:48 +0000 (+1100) Subject: address -Wshaddow of lockfile X-Git-Tag: v9.11.0a1~935 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=d869bc7685f47ba0c18f6343d3eee414aac1ebb5;p=thirdparty%2Fbind9.git address -Wshaddow of lockfile --- diff --git a/bin/named/unix/os.c b/bin/named/unix/os.c index 4bbb8d0424f..51062b49b04 100644 --- a/bin/named/unix/os.c +++ b/bin/named/unix/os.c @@ -872,7 +872,7 @@ ns_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user) { void ns_os_writepidfile(const char *filename, isc_boolean_t first_time) { - FILE *lockfile; + FILE *fh; pid_t pid; char strbuf[ISC_STRERRORSIZE]; void (*report)(const char *, ...); @@ -895,9 +895,9 @@ ns_os_writepidfile(const char *filename, isc_boolean_t first_time) { return; } - lockfile = ns_os_openfile(filename, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, + fh = ns_os_openfile(filename, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, first_time); - if (lockfile == NULL) { + if (fh == NULL) { cleanup_pidfile(); return; } @@ -906,19 +906,19 @@ ns_os_writepidfile(const char *filename, isc_boolean_t first_time) { #else pid = getpid(); #endif - if (fprintf(lockfile, "%ld\n", (long)pid) < 0) { + if (fprintf(fh, "%ld\n", (long)pid) < 0) { (*report)("fprintf() to pid file '%s' failed", filename); - (void)fclose(lockfile); + (void)fclose(fh); cleanup_pidfile(); return; } - if (fflush(lockfile) == EOF) { + if (fflush(fh) == EOF) { (*report)("fflush() to pid file '%s' failed", filename); - (void)fclose(lockfile); + (void)fclose(fh); cleanup_pidfile(); return; } - (void)fclose(lockfile); + (void)fclose(fh); } isc_boolean_t