]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/miri/src/shims/unix/thread.rs
make eval_libc functions ICE on any problem
[rust.git] / src / tools / miri / src / shims / unix / thread.rs
index b43682710bbe5c4adfba87955bb184f259348845..4f7b028d35dbfaf6705c8b05f78933d40f300dd0 100644 (file)
@@ -19,7 +19,7 @@ fn pthread_create(
 
         let func_arg = this.read_immediate(arg)?;
 
-        this.start_thread(
+        this.start_regular_thread(
             Some(thread_info_place),
             start_routine,
             Abi::C { unwind: false },
@@ -84,7 +84,7 @@ fn pthread_setname_np(
 
         // Comparing with `>=` to account for null terminator.
         if name.len() >= max_name_len {
-            return this.eval_libc("ERANGE");
+            return Ok(this.eval_libc("ERANGE"));
         }
 
         this.set_thread_name(thread, name);
@@ -107,7 +107,7 @@ fn pthread_getname_np(
         let name = this.get_thread_name(thread).to_owned();
         let (success, _written) = this.write_c_str(&name, name_out, len)?;
 
-        if success { Ok(Scalar::from_u32(0)) } else { this.eval_libc("ERANGE") }
+        Ok(if success { Scalar::from_u32(0) } else { this.eval_libc("ERANGE") })
     }
 
     fn sched_yield(&mut self) -> InterpResult<'tcx, i32> {