mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
52231de913
commit
c6b9f2913a
3 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
Sun Oct 20 15:29:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* 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@ruby-lang.org>
|
||||
|
||||
* include/ruby/ruby.h (rb_obj_wb_unprotect, rb_obj_written),
|
||||
|
|
9
error.c
9
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) : "";
|
||||
|
|
|
@ -413,12 +413,15 @@ void Init_File(void);
|
|||
# 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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue