* configure.in: Added mode_t type checking.

* process.c (rb_exec_arg_addopt): Use NUM2MODET() instead
	  NUM2LONG because clang makes compile error by this narrowing
	  conversion.
	* process.c (rb_run_exec_options_err): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2011-01-28 02:00:08 +00:00
Родитель 58da04b398
Коммит 92c1dfd9d2
3 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,11 @@
Fri Jan 28 10:58:20 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* configure.in: Added mode_t type checking.
* process.c (rb_exec_arg_addopt): Use NUM2MODET() instead
NUM2LONG because clang makes compile error by this narrowing
conversion.
* process.c (rb_run_exec_options_err): ditto.
Fri Jan 28 02:37:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* re.c (rb_reg_raise): add GC guard to prevent intermediate

Просмотреть файл

@ -686,6 +686,7 @@ RUBY_REPLACE_TYPE(uid_t, int, UIDT)
RUBY_REPLACE_TYPE(gid_t, int, GIDT)
RUBY_REPLACE_TYPE(time_t, [], TIMET, [@%:@include <time.h>])
RUBY_REPLACE_TYPE(dev_t, [int long "long long"], DEVT)
RUBY_REPLACE_TYPE(mode_t, ["unsigned int" long], MODET, [@%:@include <sys/stat.h>])
AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
[AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],

Просмотреть файл

@ -1516,7 +1516,7 @@ rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val)
hide_obj(rb_str_dup(val)));
}
else if (id == rb_intern("umask")) {
mode_t cmask = NUM2LONG(val);
mode_t cmask = NUM2MODET(val);
if (!NIL_P(rb_ary_entry(options, EXEC_OPTION_UMASK))) {
rb_raise(rb_eArgError, "umask option specified twice");
}
@ -2335,7 +2335,7 @@ rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char
obj = rb_ary_entry(options, EXEC_OPTION_UMASK);
if (!NIL_P(obj)) {
mode_t mask = NUM2LONG(obj);
mode_t mask = NUM2MODET(obj);
mode_t oldmask = umask(mask); /* never fail */
if (!NIL_P(soptions))
rb_ary_store(soptions, EXEC_OPTION_UMASK, LONG2NUM(oldmask));