summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-31 19:10:19 (GMT)
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-31 19:10:19 (GMT)
commitc9d41f60550bc9451b08009940376908f4144054 (patch)
tree358bfee02416d61619a629cf9e2fe3daa4874ac9 /dir.c
parent5f77f1e30dcce93e6067aa484a6d87c5df1eb958 (diff)
use mode_t where applicable (instead of int)
mode_t is the correct type for these syscalls and it can be easier-to-understand. It may also help portability to future platforms and improve type checking. * dir.c (dir_s_mkdir): use mode_t for mkdir(2) * file.c (chmod_internal): use mode_t for chmod(2) (rb_file_s_chmod): s/int/mode_t/ (lchmod_internal): ditto, deref pointer as in chmod_internal (rb_file_s_lchmod): pass pointer as in rb_file_s_chmod (rb_file_s_rename): use mode_t for umask(2) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index f8bdf1d..5d02b2a 100644
--- a/dir.c
+++ b/dir.c
@@ -1218,10 +1218,10 @@ static VALUE
dir_s_mkdir(int argc, VALUE *argv, VALUE obj)
{
VALUE path, vmode;
- int mode;
+ mode_t mode;
if (rb_scan_args(argc, argv, "11", &path, &vmode) == 2) {
- mode = NUM2INT(vmode);
+ mode = NUM2MODET(vmode);
}
else {
mode = 0777;