[前][次][番号順一覧][スレッド一覧]

ruby-changes:5637

From: nobu <ko1@a...>
Date: Fri, 13 Jun 2008 14:25:15 +0900 (JST)
Subject: [ruby-changes:5637] Ruby:r17144 (ruby_1_8, trunk): * gc.c (rb_memerror): exit with EXIT_FAILURE instead of magic number.

nobu	2008-06-13 14:24:40 +0900 (Fri, 13 Jun 2008)

  New Revision: 17144

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/gc.c
    trunk/ChangeLog
    trunk/gc.c

  Log:
    * gc.c (rb_memerror): exit with EXIT_FAILURE instead of magic number.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=17144&r2=17143&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=17144&r2=17143&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/gc.c?r1=17144&r2=17143&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/gc.c?r1=17144&r2=17143&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 17143)
+++ ChangeLog	(revision 17144)
@@ -1,5 +1,7 @@
-Fri Jun 13 14:18:54 2008  Nobuyoshi Nakada  <nobu@r...>
+Fri Jun 13 14:24:37 2008  Nobuyoshi Nakada  <nobu@r...>
 
+	* gc.c (rb_memerror): exit with EXIT_FAILURE instead of magic number.
+
 	* gc.c (ruby_stack_check): STACK_LENGTH should be less than
 	  STACK_LEVEL_MAX.
 
Index: gc.c
===================================================================
--- gc.c	(revision 17143)
+++ gc.c	(revision 17144)
@@ -273,7 +273,7 @@
     if (!nomem_error ||
 	(rb_thread_raised_p(th, RAISED_NOMEMORY) && rb_safe_level() < 4)) {
 	fprintf(stderr, "[FATAL] failed to allocate memory\n");
-	exit(1);
+	exit(EXIT_FAILURE);
     }
     rb_thread_raised_set(th, RAISED_NOMEMORY);
     rb_exc_raise(nomem_error);
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 17143)
+++ ruby_1_8/ChangeLog	(revision 17144)
@@ -1,5 +1,7 @@
-Fri Jun 13 14:19:09 2008  Nobuyoshi Nakada  <nobu@r...>
+Fri Jun 13 14:24:37 2008  Nobuyoshi Nakada  <nobu@r...>
 
+	* 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.
 
Index: ruby_1_8/gc.c
===================================================================
--- ruby_1_8/gc.c	(revision 17143)
+++ ruby_1_8/gc.c	(revision 17144)
@@ -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 @@
 
     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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]