From: Eric Bollengier Date: Thu, 4 Jul 2024 06:54:11 +0000 (+0200) Subject: Fix windows compilation X-Git-Tag: Release-15.0.3~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d991fb3c7829bc5beb9817df2926b8c084444e1;p=thirdparty%2Fbacula.git Fix windows compilation --- diff --git a/bacula/src/lib/bsys.c b/bacula/src/lib/bsys.c index e75002c45..180b66c24 100644 --- a/bacula/src/lib/bsys.c +++ b/bacula/src/lib/bsys.c @@ -2172,6 +2172,7 @@ static int bclose_closefrom(int start_fd) /* Check the FDs that are currently open */ static int check_open_fd() { +#ifndef HAVE_WIN32 int max_fd = 0; struct dirent *entry; DIR *dir = opendir(PROC_SELF_FD); @@ -2206,6 +2207,8 @@ static int check_open_fd() } closedir(dir); return max_fd; +#endif + return -1; } static int bclose_proc_self(int start_fd) @@ -2239,6 +2242,7 @@ int bclose_from(int start_fd) /* Many systems doesn't have the correct system call * to determine the FD list to close. */ +#if !defined(HAVE_FCNTL_F_CLOSEM) && !defined(HAVE_CLOSEFROM) && !defined(HAVE_WIN32) struct rlimit rl; int64_t rlimitResult=0; @@ -2251,6 +2255,8 @@ int bclose_from(int start_fd) close(i); } return 4; +#endif + return 5; } #ifdef TEST_PROGRAM