mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 01:54:00 +02:00
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1db8e80b29
commit
2a1b0ff232
9 changed files with 77 additions and 22 deletions
8
file.c
8
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue