]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
needed fixes for windows build
authorEvan Hunt <each@isc.org>
Wed, 5 Aug 2009 18:43:37 +0000 (18:43 +0000)
committerEvan Hunt <each@isc.org>
Wed, 5 Aug 2009 18:43:37 +0000 (18:43 +0000)
bin/named/win32/include/named/os.h
bin/named/win32/os.c

index cdfc90796ebab60a209bcbbb6eb31308ddaf2e86..5724444debb229f8681a31030c50ad2dd478b85c 100644 (file)
@@ -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);
index 6eed888adebedf0ae5fc8c454aa61494bf43290a..39151ed1477dc29d9f4e8dd38d30e6a78691736e 100644 (file)
  * 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 <config.h>
 #include <stdarg.h>
 
+#include <sys/types.h>
 #include <sys/stat.h>
 
 #include <ctype.h>
@@ -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);