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

ruby-changes:27707

From: naruse <ko1@a...>
Date: Fri, 15 Mar 2013 08:25:26 +0900 (JST)
Subject: [ruby-changes:27707] naruse:r39759 (trunk): * file.c (rb_sys_fail_path): define & use rb_sys_fail_path0 like r39752

naruse	2013-03-15 08:25:09 +0900 (Fri, 15 Mar 2013)

  New Revision: 39759

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39759

  Log:
    * file.c (rb_sys_fail_path): define & use rb_sys_fail_path0 like r39752

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39758)
+++ ChangeLog	(revision 39759)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Mar 15 08:24:51 2013  NARUSE, Yui  <naruse@r...>
+
+	* file.c (rb_sys_fail_path): define & use rb_sys_fail_path0 like r39752
+
 Fri Mar 15 04:08:00 2013  Zachary Scott  <zachary@z...>
 
 	* proc.c: Typo in Proc.arity found by Jack Nagel [Bug #8094]
Index: io.c
===================================================================
--- io.c	(revision 39758)
+++ io.c	(revision 39759)
@@ -399,7 +399,20 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd https://github.com/ruby/ruby/blob/trunk/io.c#L399
 #  endif
 #endif
 
-#define rb_sys_fail_path(path) rb_sys_fail_str(path)
+#ifdef RUBY_FUNCTION_NAME_STRING
+# define rb_sys_fail_path(path) rb_sys_fail_path0(RUBY_FUNCTION_NAME_STRING, path)
+NORETURN(static void rb_sys_fail_path0(const char *,VALUE));
+static void
+rb_sys_fail_path0(const char *func_name, VALUE path)
+{
+    VALUE mesg = rb_str_new_cstr(func_name);
+    rb_str_buf_cat2(mesg, ": ");
+    rb_str_buf_append(mesg, path);
+    rb_sys_fail_str(mesg);
+}
+#else
+# define rb_sys_fail_path(path) rb_sys_fail_str(path)
+#endif
 
 static int io_fflush(rb_io_t *);
 static rb_io_t *flush_before_seek(rb_io_t *fptr);

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

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