14 static bool fd_is_valid(int fd)
17 if ((HANDLE)_get_osfhandle(fd) != INVALID_HANDLE_VALUE) return true;
30 static int fd_count(const char *when)
34 printf("fds open at %s:", when);
36 for (int fd = 0; fd < 1024; fd++)
51 int main(int argc, char **argv)
54 setup_console_crash();
57 // test wvtest itself. Not very thorough, but you have to draw the
64 char * const *prefixes = NULL;
69 startfd = fd_count("start");
70 int ret = WvTest::run_all(prefixes);
72 if (ret == 0) // don't pollute the strace output if we failed anyway
74 endfd = fd_count("end");
76 WVPASS(startfd == endfd);
79 system(WvString("ls -l /proc/%s/fd", getpid()));
83 // keep 'make' from aborting if this environment variable is set
84 if (getenv("WVTEST_NO_FAIL"))