summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-13 05:39:35 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-13 05:39:35 +0000
commit2a1b0ff2326ae53c299206f983413fa00a2c7ec5 (patch)
tree84e15b31de72e95a48dc2f0063477bba838b8060 /file.c
parent1db8e80b29f41a3e413626bca4b95ff6a4cfe522 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/file.c b/file.c
index 737ed5d88e..98098f9047 100644
--- a/file.c
+++ b/file.c
@@ -940,12 +940,12 @@ rb_file_chmod(obj, vmode)
mode = NUM2INT(vmode);
GetOpenFile(obj, fptr);
-#if defined(DJGPP) || defined(NT) || defined(__BEOS__) || defined(__EMX__)
- if (!fptr->path) return Qnil;
- if (chmod(fptr->path, mode) == -1)
+#ifdef HAVE_FCHMOD
+ if (fchmod(fileno(fptr->f), mode) == -1)
rb_sys_fail(fptr->path);
#else
- if (fchmod(fileno(fptr->f), mode) == -1)
+ if (!fptr->path) return Qnil;
+ if (chmod(fptr->path, mode) == -1)
rb_sys_fail(fptr->path);
#endif