raise a SystemCallError when lseek(2) fails.

This commit is contained in:
Tomoyuki Sahara
2015-10-20 15:39:28 +09:00
parent 21963f8fa1
commit db7d829679
+1 -1
View File
@@ -535,7 +535,7 @@ mrb_io_sysseek(mrb_state *mrb, mrb_value io)
fptr = (struct mrb_io *)mrb_get_datatype(mrb, io, &mrb_io_type);
pos = lseek(fptr->fd, offset, whence);
if (pos < 0) {
mrb_raise(mrb, E_IO_ERROR, "sysseek failed");
mrb_sys_fail(mrb, "sysseek");
}
return mrb_fixnum_value(pos);