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 637b68def9..f63dbcd120 100644
--- a/io.c
+++ b/io.c
@@ -1691,8 +1691,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;
}