diff --git a/lib/roken/NTMakefile b/lib/roken/NTMakefile index 107ac0277..28e96c348 100644 --- a/lib/roken/NTMakefile +++ b/lib/roken/NTMakefile @@ -37,6 +37,7 @@ libroken_la_OBJS = \ $(OBJ)\base64.obj \ $(OBJ)\bswap.obj \ $(OBJ)\concat.obj \ + $(OBJ)\cloexec.obj \ $(OBJ)\dirent.obj \ $(OBJ)\dlfcn_w32.obj \ $(OBJ)\dumpdata.obj \ @@ -102,7 +103,8 @@ libroken_la_OBJS = \ $(OBJ)\vwarnx.obj \ $(OBJ)\warn.obj \ $(OBJ)\warnerr.obj \ - $(OBJ)\warnx.obj + $(OBJ)\warnx.obj \ + $(OBJ)\xfree.obj {}.c{$(OBJ)}.obj: $(C2OBJ) -DBUILD_ROKEN_LIB diff --git a/lib/roken/cloexec.c b/lib/roken/cloexec.c index c015b1d8f..901512a9d 100644 --- a/lib/roken/cloexec.c +++ b/lib/roken/cloexec.c @@ -33,14 +33,12 @@ #include -#include -#include - #include "roken.h" void ROKEN_LIB_FUNCTION rk_cloexec(int fd) { +#ifdef HAVE_FCNTL int ret; ret = fcntl(fd, F_GETFD); @@ -48,10 +46,13 @@ rk_cloexec(int fd) return; if (fcntl(fd, F_SETFD, ret | FD_CLOEXEC) == -1) return; +#endif } void ROKEN_LIB_FUNCTION rk_cloexec_file(FILE *f) { +#ifdef HAVE_FCNTL rk_cloexec(fileno(f)); +#endif } diff --git a/lib/roken/xfree.c b/lib/roken/xfree.c index 13366ce13..c7e30daf8 100644 --- a/lib/roken/xfree.c +++ b/lib/roken/xfree.c @@ -33,8 +33,6 @@ #include -#include - #include "roken.h" void ROKEN_LIB_FUNCTION