Searched refs:nullfd (Results 1 – 2 of 2) sorted by relevance
721 int nullfd, dupfd; in sanitise_stdfd() local723 if ((nullfd = dupfd = open(_PATH_DEVNULL, O_RDWR)) == -1) { in sanitise_stdfd()732 if (dup2(nullfd, dupfd) == -1) { in sanitise_stdfd()737 if (nullfd > 2) in sanitise_stdfd()738 close(nullfd); in sanitise_stdfd()
286 int nullfd; in main() local356 nullfd = open("/dev/null", O_RDWR); in main()357 dup2(nullfd, STDOUT_FILENO); in main()358 dup2(nullfd, STDERR_FILENO); in main()359 dup2(nullfd, STDIN_FILENO); in main()360 close(nullfd); in main()