From: James Jones Date: Mon, 13 Dec 2021 20:04:33 +0000 (-0600) Subject: Make closefrom return void as per /usr/include/unistd.h (#4336) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c493e273e22fd5aae1b9e5dbf980e74aef3b6768;p=thirdparty%2Ffreeradius-server.git Make closefrom return void as per /usr/include/unistd.h (#4336) --- diff --git a/src/include/missing-h b/src/include/missing-h index 0d1d469b49..2ccd1411ea 100644 --- a/src/include/missing-h +++ b/src/include/missing-h @@ -166,7 +166,7 @@ int sendmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen, int flags); #endif #ifndef HAVE_CLOSEFROM -int closefrom(int fd); +void closefrom(int fd); #endif #ifndef HAVE_SETLINEBUF diff --git a/src/lib/util/missing.c b/src/lib/util/missing.c index e918b34e28..9c5c416737 100644 --- a/src/lib/util/missing.c +++ b/src/lib/util/missing.c @@ -548,7 +548,7 @@ int sendmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen, int flags) # endif #endif -int closefrom(int fd) +void closefrom(int fd) { int i; int maxfd = 256; @@ -557,7 +557,7 @@ int closefrom(int fd) # endif #ifdef F_CLOSEM - if (fcntl(fd, F_CLOSEM) == 0) return 0; + if (fcntl(fd, F_CLOSEM) == 0) return; # endif # ifdef F_MAXFD @@ -595,7 +595,7 @@ int closefrom(int fd) } } (void) closedir(dir); - return 0; + return; } # endif @@ -603,7 +603,7 @@ int closefrom(int fd) do_close: # endif - if (fd > maxfd) return 0; + if (fd > maxfd) return; /* * FIXME: return EINTR? @@ -612,6 +612,6 @@ do_close: close(i); } - return 0; + return; } #endif