about summary refs log tree commit diff stats
path: root/src/io
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-12 16:08:48 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-12 16:08:48 +0100
commit73311e5698a8fd53dc6b18e20d02b93e2b2ac487 (patch)
tree47c9ab3746a27e520cec6b03815de8c6cc05eb49 /src/io
parent0ce77eeb07b40f1c664308b7029474d52142afe8 (diff)
downloadchawan-73311e5698a8fd53dc6b18e20d02b93e2b2ac487.tar.gz
posixstream: do not ignore lseek result
Diffstat (limited to 'src/io')
-rw-r--r--src/io/posixstream.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/io/posixstream.nim b/src/io/posixstream.nim
index baf3238c..911f384b 100644
--- a/src/io/posixstream.nim
+++ b/src/io/posixstream.nim
@@ -70,7 +70,8 @@ method setBlocking*(s: PosixStream, blocking: bool) {.base.} =
     discard fcntl(s.fd, F_SETFL, ofl or O_NONBLOCK)
 
 method seek*(s: PosixStream; off: int) =
-  discard lseek(s.fd, Off(off), SEEK_SET)
+  if lseek(s.fd, Off(off), SEEK_SET) == -1:
+    raisePosixIOError()
 
 method sclose*(s: PosixStream) =
   discard close(s.fd)