summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/io.c b/io.c
index 3785487a88..018c74ce86 100644
--- a/io.c
+++ b/io.c
@@ -1696,8 +1696,9 @@ rb_io_ungetc(io, c)
rb_raise(rb_eIOError, "unread stream");
rb_io_check_readable(fptr);
- if (ungetc(cc, fptr->f) == EOF && cc != EOF)
- rb_sys_fail(fptr->path);
+ if (ungetc(cc, fptr->f) == EOF && cc != EOF) {
+ rb_raise(rb_eIOError, "ungetc failed");
+ }
return Qnil;
}