about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-10-26 09:09:14 +0200
committerRalf Jung <post@ralfj.de>2024-10-26 09:10:11 +0200
commit4a34e2784b4eb0bb2c0c3740141937c88c4e4cfd (patch)
treee74d7c011abbeee759e957123acc03a80cc46f70
parent3f763c776eaeb0f2c088ec1fec6284d16e66564f (diff)
downloadrust-4a34e2784b4eb0bb2c0c3740141937c88c4e4cfd.tar.gz
rust-4a34e2784b4eb0bb2c0c3740141937c88c4e4cfd.zip
do not set the file type to an error code
-rw-r--r--src/tools/miri/src/shims/unix/fs.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/miri/src/shims/unix/fs.rs b/src/tools/miri/src/shims/unix/fs.rs
index e88f62ffbb2..eed6a7b04ff 100644
--- a/src/tools/miri/src/shims/unix/fs.rs
+++ b/src/tools/miri/src/shims/unix/fs.rs
@@ -339,7 +339,10 @@ trait EvalContextExtPrivate<'tcx>: crate::MiriInterpCxExt<'tcx> {
                     _ => interp_ok(this.eval_libc("DT_UNKNOWN").to_u8()?.into()),
                 }
             }
-            Err(e) => this.io_error_to_errnum(e)?.to_i32(),
+            Err(_) => {
+                // Fallback on error
+                interp_ok(this.eval_libc("DT_UNKNOWN").to_u8()?.into())
+            }
         }
     }
 }