X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=string.c;h=bdc113d3586c63059311968275f6134f5a9037b9;hp=d23e43c1eecb1d34e4eaefda77423da076ab412a;hb=40de1dd2fdbb054444d585aa70e2d50166a66e07;hpb=07dd05be81f44b0af666a8bccf0a19ffff371db1 diff --git a/string.c b/string.c index d23e43c1..bdc113d3 100644 --- a/string.c +++ b/string.c @@ -328,27 +328,6 @@ __must_check unsigned split_args(char *args, char *** const argv_ptr, const char return n; } -/** - * Ensure that file descriptors 0, 1, and 2 are valid. - * - * Common approach that opens /dev/null until it gets a file descriptor greater - * than two. - * - * \sa okir's Black Hats Manual. - */ -void valid_fd_012(void) -{ - while (1) { - int fd = open("/dev/null", O_RDWR); - if (fd < 0) - exit(EXIT_FAILURE); - if (fd > 2) { - close(fd); - break; - } - } -} - /** * Get the own hostname. *