autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix autoreconf -fvi failure on OS/2


From: KO Myung-Hun
Subject: [PATCH] Fix autoreconf -fvi failure on OS/2
Date: Sun, 9 Feb 2025 12:07:51 +0900

OS/2 does not allow file actions with a file name to opened files. As a
result, copy(), chmod() and update_file() fail. Instead, use file handles
if possible and close files before using them.

* bin/autoreconf.in (install_aux_file) [OS/2]: Pass a file handle to
copy() and chmod(). And close a file before update_file().
---
 bin/autoreconf.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/autoreconf.in b/bin/autoreconf.in
index 74c9890e..11e3c0fe 100644
--- a/bin/autoreconf.in
+++ b/bin/autoreconf.in
@@ -400,9 +400,10 @@ sub install_aux_file
             or fatal "rm -f $dest: $!";
         }
       my ($temp, $tempname) = tempfile (UNLINK => 0, DIR => $destdir);
-      copy ($src, $tempname)
+      copy ($src, $^O eq 'os2' ? $temp : $tempname)
         or fatal "copying $src to $tempname: $!";
-      make_executable ($tempname) if -x $src;
+      make_executable ($^O eq 'os2' ? $temp : $tempname) if -x $src;
+      close ($temp) if $^O eq 'os2';
       update_file ($tempname, $dest, $force);
     }
 }
-- 
2.42.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]