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

ruby-changes:31293

From: nobu <ko1@a...>
Date: Sun, 20 Oct 2013 15:29:13 +0900 (JST)
Subject: [ruby-changes:31293] nobu:r43372 (trunk): internal.h: rb_syserr_fail_path

nobu	2013-10-20 15:29:06 +0900 (Sun, 20 Oct 2013)

  New Revision: 43372

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

  Log:
    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.

  Modified files:
    trunk/ChangeLog
    trunk/error.c
    trunk/internal.h
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43371)
+++ ChangeLog	(revision 43372)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Oct 20 15:29:05 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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.
+
 Sun Oct 20 13:58:47 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/ruby.h (rb_obj_wb_unprotect, rb_obj_written),
Index: error.c
===================================================================
--- error.c	(revision 43371)
+++ error.c	(revision 43372)
@@ -1967,9 +1967,16 @@ void https://github.com/ruby/ruby/blob/trunk/error.c#L1967
 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) : "";
Index: internal.h
===================================================================
--- internal.h	(revision 43371)
+++ internal.h	(revision 43372)
@@ -413,12 +413,15 @@ void Init_File(void); https://github.com/ruby/ruby/blob/trunk/internal.h#L413
 #   pragma GCC visibility push(default)
 # endif
 NORETURN(void rb_sys_fail_path_in(const char *func_name, VALUE path));
+NORETURN(void rb_syserr_fail_path_in(const char *func_name, int err, VALUE path));
 # if defined __GNUC__ && __GNUC__ >= 4
 #   pragma GCC visibility pop
 # endif
 # define rb_sys_fail_path(path) rb_sys_fail_path_in(RUBY_FUNCTION_NAME_STRING, path)
+# define rb_syserr_fail_path(err, path) rb_syserr_fail_path_in(RUBY_FUNCTION_NAME_STRING, (err), (path))
 #else
 # define rb_sys_fail_path(path) rb_sys_fail_str(path)
+# define rb_syserr_fail_path(err, path) rb_sys_fail_str((err), (path))
 #endif
 
 /* gc.c */

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

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