summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-25 12:32:19 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-25 12:32:19 +0000
commit0f377c1c1038d3a56f1fa5508127b96fd1f43c6d (patch)
treeb69b749678f98d8040368f86f1b6f24accc678ed /dir.c
parent5e808b6ba38dbd974b617e80e2cf054eaaca604f (diff)
merge revision(s) 34786,34787,34788,34789:
* dir.c, file.c, io.c: use rb_sys_fail_path. * error.c: new functions to deal exceptions with string instances. * dir.c, file.c, io.c (rb_sys_fail_path): use rb_sys_fail_str. * test/ruby/test_literal.rb (TestRubyLiteral#test_special_const): test for https://bugs.php.net/bug.php?id=61095 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/dir.c b/dir.c
index 0987e8ecc4..404dc0d42f 100644
--- a/dir.c
+++ b/dir.c
@@ -80,6 +80,8 @@ char *strchr(char*,char);
#define opendir(p) rb_w32_uopendir(p)
#endif
+#define rb_sys_fail_path(path) rb_sys_fail_str(path)
+
#define FNM_NOESCAPE 0x01
#define FNM_PATHNAME 0x02
#define FNM_DOTMATCH 0x04
@@ -762,7 +764,7 @@ dir_chdir(VALUE path)
{
path = rb_str_encode_ospath(path);
if (chdir(RSTRING_PTR(path)) < 0)
- rb_sys_fail(RSTRING_PTR(path));
+ rb_sys_fail_path(path);
}
static int chdir_blocking = 0;
@@ -934,7 +936,7 @@ dir_s_chroot(VALUE dir, VALUE path)
path = rb_str_encode_ospath(path);
if (chroot(RSTRING_PTR(path)) == -1)
- rb_sys_fail(RSTRING_PTR(path));
+ rb_sys_fail_path(path);
return INT2FIX(0);
}
@@ -973,7 +975,7 @@ dir_s_mkdir(int argc, VALUE *argv, VALUE obj)
check_dirname(&path);
path = rb_str_encode_ospath(path);
if (mkdir(RSTRING_PTR(path), mode) == -1)
- rb_sys_fail(RSTRING_PTR(path));
+ rb_sys_fail_path(path);
return INT2FIX(0);
}
@@ -993,7 +995,7 @@ dir_s_rmdir(VALUE obj, VALUE dir)
check_dirname(&dir);
dir = rb_str_encode_ospath(dir);
if (rmdir(RSTRING_PTR(dir)) < 0)
- rb_sys_fail(RSTRING_PTR(dir));
+ rb_sys_fail_path(dir);
return INT2FIX(0);
}