]> git.ipfire.org Git - thirdparty/autoconf.git/commit
autom4te: OS/2 compat: Do not attempt to chmod an open file.
authorZack Weinberg <zack@owlfolio.org>
Wed, 18 Oct 2023 17:23:36 +0000 (13:23 -0400)
committerZack Weinberg <zack@owlfolio.org>
Wed, 18 Oct 2023 17:23:36 +0000 (13:23 -0400)
commitc4a695510d240491f89d78204a3d5a6fdbe03648
tree007c5df242449a75a8e491f40f10e11dcb908675
parentcb6fbab55de1e9660e110857ae248a70a8b48c5b
autom4te: OS/2 compat: Do not attempt to chmod an open file.

On OS/2, chmod(2) cannot be applied to an open file.

Instead set the desired permissions when the file is initially
created, using the PERMS argument to File::Temp::tempfile if
possible, or by manually emulating that feature if the system
perl does not provide a new enough version of File::Temp.

This has the nice side effect that we no longer need to handle
the umask manually.

* autom4te.in (tempfile_with_mode): New function.
  (handle_output): Use tempfile_with_mode instead of directly using
  File::Temp plus chmod.

Co-authored-by: KO Myung-Hun <komh78@gmail.com>
bin/autom4te.in