X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=string.c;h=c73ec1e6d70377b24bafcb9462035067099fc945;hb=2ca70d00ec9b4486bca372873041c9e0233d36c4;hp=752fb8f945d1a381b7b7af4e65ed56b646df8d47;hpb=c8d6b9290983715325da4f6453d13c6d53e1d418;p=paraslash.git diff --git a/string.c b/string.c index 752fb8f9..c73ec1e6 100644 --- a/string.c +++ b/string.c @@ -327,27 +327,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. *