Skip to content

Commit c44f1ae

Browse files
committed
Auto merge of #1483 - RalfJung:fs-errno, r=RalfJung
set errno on stdout write failure
2 parents b021209 + cded9b7 commit c44f1ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/shims/posix/foreign_items.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
133133
};
134134
match res {
135135
Ok(n) => i64::try_from(n).unwrap(),
136-
// FIXME: set errno to appropriate value
137-
Err(_) => -1,
136+
Err(e) => {
137+
this.set_last_error_from_io_error(e)?;
138+
-1
139+
}
138140
}
139141
} else {
140142
this.write(fd, buf, count)?

0 commit comments

Comments
 (0)