]> git.lizzy.rs Git - rust.git/commitdiff
Error with EINVAL on unsupported `whence` argument
authorDavid Cook <divergentdave@gmail.com>
Thu, 30 Jan 2020 01:04:18 +0000 (19:04 -0600)
committerDavid Cook <divergentdave@gmail.com>
Thu, 30 Jan 2020 01:04:18 +0000 (19:04 -0600)
src/shims/fs.rs

index 4cfff9446b852461c263ad6149bbe56a0e2bacfd..388117daee6bb2b4da86020648383456acae1b49 100644 (file)
@@ -285,7 +285,9 @@ fn lseek64(
         } else if whence == this.eval_libc_i32("SEEK_END")? {
             SeekFrom::End(offset)
         } else {
-            throw_unsup_format!("Unsupported whence argument to lseek64: {}", whence)
+            let einval = this.eval_libc("EINVAL")?;
+            this.set_last_error(einval)?;
+            return Ok(-1);
         };
 
         if let Some(handle) = this.machine.file_handler.handles.get_mut(&fd) {