Skip to content

Commit

Permalink
Log errors from close instead of ignoring them.
Browse files Browse the repository at this point in the history
They shouldn't matter but there have been errors on Macs so logging
them may help root cause the issue.
  • Loading branch information
jesse99 authored and brson committed Nov 26, 2012
1 parent 8adacc0 commit 065d642
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rt/rust_util.h
Expand Up @@ -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
}

Expand Down

0 comments on commit 065d642

Please sign in to comment.