From 027a73a903af306449710ce12bc09e0e3550c6c9 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 4 Aug 2016 10:16:59 -0500 Subject: Make xopen() skip stdin/stdout/stderr, add xopen_stdio() if you want stdout, add xopenro() that takes one argument and understands "-" means stdin, and switch over lots of users. --- toys/pending/dumpleases.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/pending/dumpleases.c') diff --git a/toys/pending/dumpleases.c b/toys/pending/dumpleases.c index 86cb4e76..ef17aab4 100644 --- a/toys/pending/dumpleases.c +++ b/toys/pending/dumpleases.c @@ -42,7 +42,7 @@ void dumpleases_main(void) int i, fd; if(!(toys.optflags & FLAG_f)) TT.file = "/var/lib/misc/dhcpd.leases"; //DEF_LEASE_FILE - fd = xopen(TT.file, O_RDONLY); + fd = xopenro(TT.file); xprintf("Mac Address IP Address Host Name Expires %s\n", (toys.optflags & FLAG_a) ? "at" : "in"); xread(fd, &written_time, sizeof(written_time)); current_time = time(NULL); -- cgit v1.2.3