summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-07 00:06:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-07 00:06:08 +0000
commit7b3c2c28dc774759064a08c1dde816812a88e231 (patch)
tree68e0f4f148d50168c84d87922d381e6f769819eb
parent489e05fcc9008e993cbbbc455b1d9be16974c163 (diff)
* process.c: NUM2RLIM is defined but no getrlimit and setrlimit on
mingw. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--process.c12
2 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 214666c792..da102dc5d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Mar 7 09:05:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c: NUM2RLIM is defined but no getrlimit and setrlimit on
+ mingw.
+
Mon Mar 7 08:38:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/date/date_core.c (DateTimeData): should not use bare 'long long'
diff --git a/process.c b/process.c
index 25ad168068..8711ab7c90 100644
--- a/process.c
+++ b/process.c
@@ -1427,7 +1427,7 @@ check_exec_redirect(VALUE key, VALUE val, VALUE options)
}
}
-#ifdef RLIM2NUM
+#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM)
static int rlimit_type_by_lname(const char *name);
#endif
@@ -1465,7 +1465,7 @@ rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val)
}
else
#endif
-#ifdef RLIM2NUM
+#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM)
if (strncmp("rlimit_", rb_id2name(id), 7) == 0 &&
(rtype = rlimit_type_by_lname(rb_id2name(id)+7)) != -1) {
VALUE ary = rb_ary_entry(options, EXEC_OPTION_RLIMIT);
@@ -2222,7 +2222,7 @@ run_exec_pgroup(VALUE obj, VALUE save, char *errmsg, size_t errmsg_buflen)
}
#endif
-#ifdef RLIM2NUM
+#if defined(HAVE_SETRLIMIT) && defined(RLIM2NUM)
static int
run_exec_rlimit(VALUE ary, VALUE save, char *errmsg, size_t errmsg_buflen)
{
@@ -2284,7 +2284,7 @@ rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char
}
#endif
-#ifdef RLIM2NUM
+#if defined(HAVE_SETRLIMIT) && defined(RLIM2NUM)
obj = rb_ary_entry(options, EXEC_OPTION_RLIMIT);
if (!NIL_P(obj)) {
if (run_exec_rlimit(obj, soptions, errmsg, errmsg_buflen) == -1)
@@ -3626,7 +3626,7 @@ proc_setpriority(VALUE obj, VALUE which, VALUE who, VALUE prio)
#define proc_setpriority rb_f_notimplement
#endif
-#if defined(RLIM2NUM)
+#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM)
static int
rlimit_resource_name2int(const char *name, int casetype)
{
@@ -5690,7 +5690,7 @@ Init_process(void)
rb_define_module_function(rb_mProcess, "getrlimit", proc_getrlimit, 1);
rb_define_module_function(rb_mProcess, "setrlimit", proc_setrlimit, -1);
-#ifdef RLIM2NUM
+#if defined(RLIM2NUM) && defined(RLIM_INFINITY)
{
VALUE inf = RLIM2NUM(RLIM_INFINITY);
#ifdef RLIM_SAVED_MAX