Add --detach. Add multi-pass flag parsing that lets us get things in the right order.

This commit is contained in:
Ian Gulliver
2016-03-08 11:26:39 -08:00
parent 70ac401a23
commit e5af92c331
19 changed files with 395 additions and 329 deletions

View File

@@ -15,7 +15,7 @@ static struct buf rand_buf = BUF_INIT;
static int rand_fd;
void rand_init() {
rand_fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC);
rand_fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC | O_NOCTTY);
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;