This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Also work around renameat() kernel bug on GNU/kFreeBSD
authorJames Clarke <jrtc27@jrtc27.com>
Mon, 19 Nov 2018 14:25:56 +0000 (14:25 +0000)
committerTony Cook <tony@develop-help.com>
Mon, 19 Nov 2018 23:10:41 +0000 (10:10 +1100)
doio.c

diff --git a/doio.c b/doio.c
index cc15bf9..8d9131c 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -1461,7 +1461,7 @@ Perl_nextargv(pTHX_ GV *gv, bool nomagicopen)
 }
 
 #ifdef ARGV_USE_ATFUNCTIONS
-#  if defined(__FreeBSD__)
+#  if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 
 /* FreeBSD 11 renameat() mis-behaves strangely with absolute paths in cases where the
  * equivalent rename() succeeds
@@ -1481,7 +1481,7 @@ S_my_renameat(int olddfd, const char *oldpath, int newdfd, const char *newpath)
 
 #  else
 #    define S_my_renameat(dh1, pv1, dh2, pv2) renameat((dh1), (pv1), (dh2), (pv2))
-#  endif /* if defined(__FreeBSD__) */
+#  endif /* if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) */
 #endif
 
 static bool