mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
windows portability.
git-svn-id: file:///svn/unbound/trunk@3521 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
1af1e720d5
commit
dd174820dc
5 changed files with 17 additions and 2 deletions
|
|
@ -155,6 +155,9 @@
|
|||
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
|
||||
#undef HAVE_FSEEKO
|
||||
|
||||
/* Define to 1 if you have the `fsync' function. */
|
||||
#undef HAVE_FSYNC
|
||||
|
||||
/* Whether getaddrinfo is available */
|
||||
#undef HAVE_GETADDRINFO
|
||||
|
||||
|
|
|
|||
2
configure
vendored
2
configure
vendored
|
|
@ -18116,7 +18116,7 @@ if test "$ac_res" != no; then :
|
|||
|
||||
fi
|
||||
|
||||
for ac_func in tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent
|
||||
for ac_func in tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync
|
||||
do :
|
||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||
|
|
|
|||
|
|
@ -990,7 +990,7 @@ AC_INCLUDES_DEFAULT
|
|||
#endif
|
||||
])
|
||||
AC_SEARCH_LIBS([setusercontext], [util])
|
||||
AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent])
|
||||
AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync])
|
||||
AC_CHECK_FUNCS([setresuid],,[AC_CHECK_FUNCS([setreuid])])
|
||||
AC_CHECK_FUNCS([setresgid],,[AC_CHECK_FUNCS([setregid])])
|
||||
|
||||
|
|
|
|||
|
|
@ -1833,7 +1833,11 @@ write_unsigned_root(const char* root_anchor_file)
|
|||
if(verb && errno != 0) printf("%s\n", strerror(errno));
|
||||
}
|
||||
fflush(out);
|
||||
#ifdef HAVE_FSYNC
|
||||
fsync(fileno(out));
|
||||
#else
|
||||
FlushFileBuffers((HANDLE)_fileno(out));
|
||||
#endif
|
||||
fclose(out);
|
||||
}
|
||||
|
||||
|
|
@ -1861,7 +1865,11 @@ write_root_anchor(const char* root_anchor_file, BIO* ds)
|
|||
if(verb && errno != 0) printf("%s\n", strerror(errno));
|
||||
}
|
||||
fflush(out);
|
||||
#ifdef HAVE_FSYNC
|
||||
fsync(fileno(out));
|
||||
#else
|
||||
FlushFileBuffers((HANDLE)_fileno(out));
|
||||
#endif
|
||||
fclose(out);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1197,8 +1197,12 @@ void autr_write_file(struct module_env* env, struct trust_anchor* tp)
|
|||
}
|
||||
if(fflush(out) != 0)
|
||||
log_err("could not fflush(%s): %s", fname, strerror(errno));
|
||||
#ifdef HAVE_FSYNC
|
||||
if(fsync(fileno(out)) != 0)
|
||||
log_err("could not fsync(%s): %s", fname, strerror(errno));
|
||||
#else
|
||||
FlushFileBuffers((HANDLE)_fileno(out));
|
||||
#endif
|
||||
if(fclose(out) != 0) {
|
||||
fatal_exit("could not complete write: %s: %s",
|
||||
fname, strerror(errno));
|
||||
|
|
|
|||
Loading…
Reference in a new issue