15 static bool fd_is_valid(int fd)
18 if ((HANDLE)_get_osfhandle(fd) != INVALID_HANDLE_VALUE) return true;
31 static int fd_count(const char *when)
35 printf("fds open at %s:", when);
37 for (int fd = 0; fd < 1024; fd++)
52 int main(int argc, char **argv)
55 #if defined(_WIN32) && defined(HAVE_WVCRASH)
56 setup_console_crash();
59 // test wvtest itself. Not very thorough, but you have to draw the
66 char * const *prefixes = NULL;
71 startfd = fd_count("start");
72 int ret = WvTest::run_all(prefixes);
74 if (ret == 0) // don't pollute the strace output if we failed anyway
76 endfd = fd_count("end");
78 WVPASS(startfd == endfd);
82 sprintf(buf, "ls -l /proc/%d/fd", getpid());
88 // keep 'make' from aborting if this environment variable is set
89 if (getenv("WVTEST_NO_FAIL"))