diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-14 23:25:09 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-14 23:25:09 +0000 |
commit | bfd52c985ccc3b2e245c87c197d73150d2b8d5df (patch) | |
tree | 3f5aeeb9394b0a1e4285b050971c393916ff5088 | |
parent | 1b179216a945abba11a9906e12b8068481c12566 (diff) |
* file.c (rb_sys_fail_path): define & use rb_sys_fail_path0 like r39752
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | io.c | 15 |
2 files changed, 18 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Fri Mar 15 08:24:51 2013 NARUSE, Yui <[email protected]> + + * file.c (rb_sys_fail_path): define & use rb_sys_fail_path0 like r39752 + Fri Mar 15 04:08:00 2013 Zachary Scott <[email protected]> * proc.c: Typo in Proc.arity found by Jack Nagel [Bug #8094] @@ -399,7 +399,20 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd) # 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); |