From 73b42d32383dc8e499103eb8d6d027796fd23505 Mon Sep 17 00:00:00 2001 From: Brian May Date: Fri, 26 Aug 2022 09:15:13 +1000 Subject: [PATCH] Build rk_closefrom even if including in libc --- cf/roken-frag.m4 | 2 ++ lib/roken/closefrom.c | 2 +- lib/roken/roken.h.in | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cf/roken-frag.m4 b/cf/roken-frag.m4 index ad7245354..90e514c20 100644 --- a/cf/roken-frag.m4 +++ b/cf/roken-frag.m4 @@ -398,6 +398,8 @@ AC_BROKEN([ \ writev \ ]) +rk_LIBOBJ(closefrom) + AM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes -a "$ac_cv_func_fnmatch" = yes) diff --git a/lib/roken/closefrom.c b/lib/roken/closefrom.c index 770eb2c67..1a950f7a8 100644 --- a/lib/roken/closefrom.c +++ b/lib/roken/closefrom.c @@ -43,7 +43,7 @@ #include "roken.h" ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL -closefrom(int fd) +rk_closefrom(int fd) { int num = getdtablesize(); diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index e09c4ee89..9cb8e62f2 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -1236,9 +1236,9 @@ vis(char *, int, int, int); #if !defined(HAVE_CLOSEFROM) #define closefrom rk_closefrom -ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL -closefrom(int); #endif +ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL +rk_closefrom(int); #if !defined(HAVE_TIMEGM) #define timegm rk_timegm