From cded9b7142b3b8d0e986d85e93ea502bd7a0d668 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 18 Jul 2020 17:58:16 +0200 Subject: [PATCH] set errno on stdout write failure --- src/shims/posix/foreign_items.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shims/posix/foreign_items.rs b/src/shims/posix/foreign_items.rs index e0ad0d8d411..80611a18e4f 100644 --- a/src/shims/posix/foreign_items.rs +++ b/src/shims/posix/foreign_items.rs @@ -133,8 +133,10 @@ fn emulate_foreign_item_by_name( }; match res { Ok(n) => i64::try_from(n).unwrap(), - // FIXME: set errno to appropriate value - Err(_) => -1, + Err(e) => { + this.set_last_error_from_io_error(e)?; + -1 + } } } else { this.write(fd, buf, count)?