From 2a1b0ff2326ae53c299206f983413fa00a2c7ec5 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 13 Nov 2000 05:39:35 +0000 Subject: matz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'io.c') diff --git a/io.c b/io.c index 8394f9768b..4458323423 100644 --- a/io.c +++ b/io.c @@ -2481,7 +2481,11 @@ next_argv() fw = rb_fopen(fn, "w"); #ifndef NO_SAFE_RENAME fstat(fileno(fw), &st2); +#ifdef HAVE_FCHMOD fchmod(fileno(fw), st.st_mode); +#else + chmod(fn, st.st_mode); +#endif if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) { fchown(fileno(fw), st.st_uid, st.st_gid); } -- cgit v1.2.3