Skip to content

Commit 065d642

Browse files
jesse99brson
authored andcommitted
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.
1 parent 8adacc0 commit 065d642

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rt/rust_util.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ inline void isaac_seed(rust_kernel* kernel, uint8_t* dest, size_t size)
153153
kernel->fatal("somehow hit eof reading from /dev/urandom");
154154
amount += (size_t)ret;
155155
} while (amount < size);
156-
(void) close(fd);
156+
int ret = close(fd);
157+
if (ret != 0)
158+
kernel->log(log_warn, "error closing /dev/urandom: %s",
159+
strerror(errno));
157160
#endif
158161
}
159162

0 commit comments

Comments
 (0)