mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
needed fixes for windows build
This commit is contained in:
parent
3a87540047
commit
2ac8f58412
@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* 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
|
#ifndef NS_OS_H
|
||||||
#define NS_OS_H 1
|
#define NS_OS_H 1
|
||||||
@ -50,7 +50,7 @@ void
|
|||||||
ns_os_minprivs(void);
|
ns_os_minprivs(void);
|
||||||
|
|
||||||
FILE *
|
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
|
void
|
||||||
ns_os_writepidfile(const char *filename, isc_boolean_t first_time);
|
ns_os_writepidfile(const char *filename, isc_boolean_t first_time);
|
||||||
|
@ -15,11 +15,12 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* 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 <config.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -177,7 +178,7 @@ ns_os_minprivs(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
int fd;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
|
|
||||||
@ -206,7 +207,7 @@ cleanup_pidfile(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FILE *
|
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];
|
char strbuf[ISC_STRERRORSIZE];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int fd;
|
int fd;
|
||||||
@ -220,7 +221,7 @@ ns_os_openfile(char *filename, mode_t mode, isc_boolean_t switch_user) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fp = fdopen(fd, "w");
|
fp = fdopen(fd, "w");
|
||||||
if (lockfile == NULL) {
|
if (fp == NULL) {
|
||||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||||
ns_main_earlywarning("could not fdopen() file '%s': %s",
|
ns_main_earlywarning("could not fdopen() file '%s': %s",
|
||||||
filename, strbuf);
|
filename, strbuf);
|
||||||
@ -248,7 +249,7 @@ ns_os_writepidfile(const char *filename, isc_boolean_t first_time) {
|
|||||||
if (filename == NULL)
|
if (filename == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pidfile = strdup(filename):
|
pidfile = strdup(filename);
|
||||||
if (pidfile == NULL) {
|
if (pidfile == NULL) {
|
||||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||||
(*report)("couldn't strdup() '%s': %s", filename, strbuf);
|
(*report)("couldn't strdup() '%s': %s", filename, strbuf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user