From b03bdcd64f8c010717f014dd58025655bf7b6c51 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 21 Jan 2002 07:44:06 +0000 Subject: * 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 --- dir.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'dir.c') diff --git a/dir.c b/dir.c index e95c0cecb9..4d4fc52d0b 100644 --- a/dir.c +++ b/dir.c @@ -389,12 +389,20 @@ 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); -- cgit v1.2.3