diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-13 05:24:40 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-13 05:24:40 +0000 |
| commit | 2cec384adc5ff1ed90441fb816a09a04b01cba6c (patch) | |
| tree | 3dec1e304d8b5cc44da2d3d3c3055de285b3e956 | |
| parent | 043222ba7c04ec13791e88a4a4959e26c0712c3c (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
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | gc.c | 12 |
2 files changed, 14 insertions, 2 deletions
@@ -1,4 +1,6 @@ -Fri Jun 13 14:19:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> +Fri Jun 13 14:24:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * gc.c (rb_memerror): exit with EXIT_FAILURE instead of magic number. * gc.c (CHECK_STACK): STACK_LENGTH should be less than STACK_LEVEL_MAX. @@ -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); |
