diff options
author | Gisle Vanem <gvanem@broadpark.no> | 2004-11-19 13:50:41 +0000 |
---|---|---|
committer | Gisle Vanem <gvanem@broadpark.no> | 2004-11-19 13:50:41 +0000 |
commit | cca9fca89409a73f393d8de42b30572bba3d7a14 (patch) | |
tree | 57b0543c0984d25c48b14ad43828b0d458c871aa | |
parent | 2b403db8111a485468452ad7bfa6fb78145c8f5c (diff) |
ifdef for portable "/dev/null".
-rw-r--r-- | tests/libtest/lib518.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/libtest/lib518.c b/tests/libtest/lib518.c index f12bca6de..e981e0080 100644 --- a/tests/libtest/lib518.c +++ b/tests/libtest/lib518.c @@ -16,6 +16,12 @@ #define NUM_OPEN (FD_SETSIZE + 10) +#if defined(WIN32) || defined(_WIN32) || defined(MSDOS) +#define DEV_NULL "NUL" +#else +#define DEV_NULL "/dev/null" +#endif + int test(char *URL) { CURLcode res; @@ -25,9 +31,9 @@ int test(char *URL) /* open a lot of file descriptors */ for (i = 0; i < NUM_OPEN; i++) { - fd[i] = open("/dev/null", O_RDONLY); + fd[i] = open(DEV_NULL, O_RDONLY); if (fd[i] == -1) { - fprintf(stderr, "open: attempt #%i: failed to open /dev/null\n", i); + fprintf(stderr, "open: attempt #%i: failed to open %s\n", i, DEV_NULL); for (i--; i >= 0; i--) close(fd[i]); return CURLE_FAILED_INIT; |