Add --exec-{send,receive}

This commit is contained in:
Ian Gulliver
2016-02-28 15:53:55 -08:00
parent 29d0b33161
commit 58a8576da8
8 changed files with 198 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ static struct buf rand_buf = BUF_INIT;
static int rand_fd;
void rand_init() {
rand_fd = open("/dev/urandom", O_RDONLY);
rand_fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC);
assert(rand_fd >= 0);
assert(read(rand_fd, buf_at(&rand_buf, 0), BUF_LEN_MAX) == BUF_LEN_MAX);
rand_buf.length = BUF_LEN_MAX;