diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c index d653d6b549..9a82c71dcb 100644 --- a/src/util.c +++ b/src/util.c @@ -2605,6 +2605,15 @@ int make_stdio(int fd) { return 0; } +int make_null_stdio(void) { + int null_fd; + + if ((null_fd = open("/dev/null", O_RDWR|O_NOCTTY)) < 0) + return -errno; + + return make_stdio(null_fd); +} + bool is_clean_exit(int code, int status) { if (code == CLD_EXITED) |