From 2ac8f5841292b75f8ec2880ffb1576b0910eecff Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Wed, 5 Aug 2009 18:43:37 +0000 Subject: [PATCH] needed fixes for windows build --- bin/named/win32/include/named/os.h | 4 ++-- bin/named/win32/os.c | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/named/win32/include/named/os.h b/bin/named/win32/include/named/os.h index cdfc90796e..5724444deb 100644 --- a/bin/named/win32/include/named/os.h +++ b/bin/named/win32/include/named/os.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: os.h,v 1.15 2009/08/05 17:35:33 each Exp $ */ +/* $Id: os.h,v 1.16 2009/08/05 18:43:37 each Exp $ */ #ifndef NS_OS_H #define NS_OS_H 1 @@ -50,7 +50,7 @@ void ns_os_minprivs(void); FILE * -ns_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user); +ns_os_openfile(const char *filename, int mode, isc_boolean_t switch_user); void ns_os_writepidfile(const char *filename, isc_boolean_t first_time); diff --git a/bin/named/win32/os.c b/bin/named/win32/os.c index 6eed888ade..39151ed147 100644 --- a/bin/named/win32/os.c +++ b/bin/named/win32/os.c @@ -15,11 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: os.c,v 1.36 2009/08/05 17:35:33 each Exp $ */ +/* $Id: os.c,v 1.37 2009/08/05 18:43:37 each Exp $ */ #include #include +#include #include #include @@ -177,7 +178,7 @@ ns_os_minprivs(void) { } static int -safe_open(const char *filename, mode_t mode, isc_boolean_t append) { +safe_open(const char *filename, int mode, isc_boolean_t append) { int fd; struct stat sb; @@ -206,7 +207,7 @@ cleanup_pidfile(void) { } FILE * -ns_os_openfile(char *filename, mode_t mode, isc_boolean_t switch_user) { +ns_os_openfile(const char *filename, int mode, isc_boolean_t switch_user) { char strbuf[ISC_STRERRORSIZE]; FILE *fp; int fd; @@ -220,7 +221,7 @@ ns_os_openfile(char *filename, mode_t mode, isc_boolean_t switch_user) { } fp = fdopen(fd, "w"); - if (lockfile == NULL) { + if (fp == NULL) { isc__strerror(errno, strbuf, sizeof(strbuf)); ns_main_earlywarning("could not fdopen() file '%s': %s", filename, strbuf); @@ -248,7 +249,7 @@ ns_os_writepidfile(const char *filename, isc_boolean_t first_time) { if (filename == NULL) return; - pidfile = strdup(filename): + pidfile = strdup(filename); if (pidfile == NULL) { isc__strerror(errno, strbuf, sizeof(strbuf)); (*report)("couldn't strdup() '%s': %s", filename, strbuf);