summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-21 07:44:06 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-21 07:44:06 +0000
commitb03bdcd64f8c010717f014dd58025655bf7b6c51 (patch)
tree2758ad48fc996d8c09192dd87700cddfbce4a988 /dir.c
parent0de16b913bcc91cf944ec1f72af6848ecd51a089 (diff)
* eval.c (ruby_stop): should not trace error handler.
* signal.c (install_sighandler): do not install sighandler unless the old value is SIG_DFL. * io.c (io_write): should not raise exception on O_NONBLOCK io. * dir.c (dir_set_pos): seek should return dir, pos= should not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index e95c0cecb9..4d4fc52d0b 100644
--- a/dir.c
+++ b/dir.c
@@ -389,13 +389,21 @@ dir_seek(dir, pos)
#ifdef HAVE_SEEKDIR
GetDIR(dir, dirp);
seekdir(dirp->dir, NUM2INT(pos));
- return pos;
+ return dir;
#else
rb_notimplement();
#endif
}
static VALUE
+dir_set_pos(dir, pos)
+ VALUE dir, pos;
+{
+ dir_seek(dir, pos);
+ return pos;
+}
+
+static VALUE
dir_rewind(dir)
VALUE dir;
{
@@ -1004,7 +1012,7 @@ Init_Dir()
rb_define_method(rb_cDir,"tell", dir_tell, 0);
rb_define_method(rb_cDir,"seek", dir_seek, 1);
rb_define_method(rb_cDir,"pos", dir_tell, 0);
- rb_define_method(rb_cDir,"pos=", dir_seek, 1);
+ rb_define_method(rb_cDir,"pos=", dir_set_pos, 1);
rb_define_method(rb_cDir,"close", dir_close, 0);
rb_define_singleton_method(rb_cDir,"chdir", dir_s_chdir, -1);