From de9d264026c870afd79a8843764ccbf60367bb0e Mon Sep 17 00:00:00 2001 From: shyouhei Date: Fri, 19 Jan 2018 09:12:06 +0000 Subject: 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 --- process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'process.c') diff --git a/process.c b/process.c index c1f695895c..a983340a89 100644 --- a/process.c +++ b/process.c @@ -2348,7 +2348,7 @@ rb_execarg_parent_start1(VALUE execarg_obj) VALUE param = RARRAY_AREF(elt, 1); VALUE vpath = RARRAY_AREF(param, 0); int flags = NUM2INT(RARRAY_AREF(param, 1)); - int perm = NUM2INT(RARRAY_AREF(param, 2)); + mode_t perm = NUM2MODET(RARRAY_AREF(param, 2)); VALUE fd2v = RARRAY_AREF(param, 3); int fd2; if (NIL_P(fd2v)) { -- cgit v1.2.3