ruby-changes:39620
From: nobu <ko1@a...>
Date: Thu, 27 Aug 2015 10:04:22 +0900 (JST)
Subject: [ruby-changes:39620] nobu:r51701 (trunk): file.c: fix messages
nobu 2015-08-27 10:03:55 +0900 (Thu, 27 Aug 2015) New Revision: 51701 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51701 Log: file.c: fix messages * file.c (sys_fail2): show method function names but not "sys_fail2". Modified files: trunk/file.c Index: file.c =================================================================== --- file.c (revision 51700) +++ file.c (revision 51701) @@ -2687,9 +2687,14 @@ rb_file_s_utime(int argc, VALUE *argv) https://github.com/ruby/ruby/blob/trunk/file.c#L2687 return LONG2FIX(n); } -NORETURN(static void sys_fail2(VALUE,VALUE)); +#ifdef RUBY_FUNCTION_NAME_STRING +# define sys_fail2(s1, s2) sys_fail2_in(RUBY_FUNCTION_NAME_STRING, s1, s2) +#else +# define sys_fail2_in(func, s1, s2) sys_fail2(s1, s2) +#endif +NORETURN(static void sys_fail2_in(const char *,VALUE,VALUE)); static void -sys_fail2(VALUE s1, VALUE s2) +sys_fail2_in(const char *func, VALUE s1, VALUE s2) { VALUE str; #ifdef MAX_PATH @@ -2706,7 +2711,11 @@ sys_fail2(VALUE s1, VALUE s2) https://github.com/ruby/ruby/blob/trunk/file.c#L2711 rb_str_cat2(str, ", "); rb_str_append(str, rb_str_ellipsize(s2, max_pathlen)); rb_str_cat2(str, ")"); +#ifdef RUBY_FUNCTION_NAME_STRING + rb_sys_fail_path_in(func, str); +#else rb_sys_fail_path(str); +#endif } #ifdef HAVE_LINK -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/