diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-19 09:12:06 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-19 09:12:06 +0000 |
commit | de9d264026c870afd79a8843764ccbf60367bb0e (patch) | |
tree | 8d2183a3a4e346ff0e56cd443f6a21df32d4a838 /file.c | |
parent | 26b08ed144e8f051158d746ef5098408433cd022 (diff) | |
download | ruby-de9d264026c870afd79a8843764ccbf60367bb0e.tar.gz |
there is no guarantee that mode_t is as wide as int
POSIX only defines mode_t to be "an integer typea", and in fact
MacOS defines it to be uint16_t. We didn't have NUM2USHORT before
so it did not make sense but now that we have it. Why not check
apptopriately.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2384,12 +2384,12 @@ static VALUE rb_file_chmod(VALUE obj, VALUE vmode) { rb_io_t *fptr; - int mode; + mode_t mode; #if !defined HAVE_FCHMOD || !HAVE_FCHMOD VALUE path; #endif - mode = NUM2INT(vmode); + mode = NUM2MODET(vmode); GetOpenFile(obj, fptr); #ifdef HAVE_FCHMOD |