mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #78 from ksss/syswrite
Should raise SyscallError on IO#syswrite
This commit is contained in:
+2
-7
@@ -123,14 +123,9 @@ class IO
|
||||
def write(string)
|
||||
str = string.is_a?(String) ? string : string.to_s
|
||||
return str.size unless str.size > 0
|
||||
|
||||
len = syswrite(str)
|
||||
if len != -1
|
||||
@pos += len
|
||||
return len
|
||||
end
|
||||
|
||||
raise IOError
|
||||
@pos += len
|
||||
len
|
||||
end
|
||||
|
||||
def <<(str)
|
||||
|
||||
Reference in New Issue
Block a user