From 065d642b155f56f442aa7fd3784714ce8f6c0a29 Mon Sep 17 00:00:00 2001 From: Jesse Jones Date: Sat, 17 Nov 2012 16:50:22 -0800 Subject: [PATCH] Log errors from close instead of ignoring them. They shouldn't matter but there have been errors on Macs so logging them may help root cause the issue. --- src/rt/rust_util.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rt/rust_util.h b/src/rt/rust_util.h index cf36c0b335507..4dc29e3c56023 100644 --- a/src/rt/rust_util.h +++ b/src/rt/rust_util.h @@ -153,7 +153,10 @@ inline void isaac_seed(rust_kernel* kernel, uint8_t* dest, size_t size) kernel->fatal("somehow hit eof reading from /dev/urandom"); amount += (size_t)ret; } while (amount < size); - (void) close(fd); + int ret = close(fd); + if (ret != 0) + kernel->log(log_warn, "error closing /dev/urandom: %s", + strerror(errno)); #endif }