X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fcommon%2Ffdfill.c;h=6419e937f630c2635ba9f34fb21c2ead23f045c5;hb=d643f9eb7daeafe25ff81dcd2d4f239803823940;hp=da744c127133bec31a1eb668c9d3697a158de8fa;hpb=cfa23cc1bd01f5c44d7746b8b1839f84d5e1b6eb;p=libc-test diff --git a/src/common/fdfill.c b/src/common/fdfill.c index da744c1..6419e93 100644 --- a/src/common/fdfill.c +++ b/src/common/fdfill.c @@ -1,9 +1,15 @@ +#include #include +#include #include "test.h" void t_fdfill(void) { - int fd[2]; - while (pipe(fd) == 0); - dup(0); + int fd = 1; + if (dup(fd) == -1) { + if (errno == EMFILE) + return; + fd = open("/dev/null", O_RDONLY); + } + while(dup(fd) != -1); }