summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-13 05:24:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-13 05:24:40 +0000
commit2cec384adc5ff1ed90441fb816a09a04b01cba6c (patch)
tree3dec1e304d8b5cc44da2d3d3c3055de285b3e956 /gc.c
parent043222ba7c04ec13791e88a4a4959e26c0712c3c (diff)
* gc.c (rb_memerror): exit with EXIT_FAILURE instead of magic number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index a1df36cfa8..f19602ee05 100644
--- a/gc.c
+++ b/gc.c
@@ -22,6 +22,16 @@
#include <setjmp.h>
#include <sys/types.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifndef EXIT_SUCCESS
+#define EXIT_SUCCESS 0
+#endif
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
@@ -85,7 +95,7 @@ rb_memerror()
if (!nomem_error || (recurse > 0 && rb_safe_level() < 4)) {
fprintf(stderr, "[FATAL] failed to allocate memory\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
recurse++;
rb_exc_raise(nomem_error);