summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-09-19 06:54:11 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-09-19 06:54:11 +0000
commit6767cd760a8f5274e238fca4567071a78ac43968 (patch)
tree870d126fba698f90bbb07a7bb67ff3aab4103796 /file.c
parent67245eec7192abdc1dd0dc2510c1f6c77df89bd0 (diff)
* string.c (rb_str_init): String.new() => ""
* dir.c (dir_path): new method. * dir.c (dir_initialize): wrap DIR into struct, along with path information. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/file.c b/file.c
index dbc9ac1..68b6589 100644
--- a/file.c
+++ b/file.c
@@ -76,7 +76,7 @@ static VALUE rb_cStat;
static int
apply2files(func, vargs, arg)
- int (*func)();
+ void (*func)();
VALUE vargs;
void *arg;
{
@@ -87,8 +87,7 @@ apply2files(func, vargs, arg)
for (i=0; i<args->len; i++) {
path = args->ptr[i];
SafeStringValue(path);
- if ((*func)(RSTRING(path)->ptr, arg) < 0)
- rb_sys_fail(RSTRING(path)->ptr);
+ (*func)(RSTRING(path)->ptr, arg);
}
return args->len;
@@ -913,7 +912,7 @@ chmod_internal(path, mode)
const char *path;
int mode;
{
- if (chmod(path, mode) == -1)
+ if (chmod(path, mode) < 0)
rb_sys_fail(path);
}
@@ -963,7 +962,7 @@ lchmod_internal(path, mode)
const char *path;
int mode;
{
- if (lchmod(path, mode) == -1)
+ if (lchmod(path, mode) < 0)
rb_sys_fail(path);
}