From c6b9f2913a66e9c9d1746b3ba3564858dd5eb5b3 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 20 Oct 2013 06:29:06 +0000 Subject: internal.h: rb_syserr_fail_path * error.c (rb_syserr_fail_path_in): new function split from rb_sys_fail_path_in to raise SystemCallError without errno. * internal.h (rb_syserr_fail_path): like rb_sys_fail_path but without errno. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- error.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'error.c') diff --git a/error.c b/error.c index ec2ad350f1..c8d51c101d 100644 --- a/error.c +++ b/error.c @@ -1967,9 +1967,16 @@ void rb_sys_fail_path_in(const char *func_name, VALUE path) { int n = errno; - VALUE args[2]; errno = 0; + rb_syserr_fail_path_in(func_name, n, path); +} + +void +rb_syserr_fail_path_in(const char *func_name, int n, VALUE path) +{ + VALUE args[2]; + if (!path) path = Qnil; if (n == 0) { const char *s = !NIL_P(path) ? RSTRING_PTR(path) : ""; -- cgit v1.2.3