summaryrefslogtreecommitdiff
path: root/tests/tout_str.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-10-18 09:47:37 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-10-18 09:47:37 +0000
commita6f6e52a85d5fff57b8c05758dfe1edbd0977340 (patch)
tree2ac0b1ca16b150862e4919f7bd5f316981ec782a /tests/tout_str.c
parentedae17e3167ac9504ebb12901c186e519242d57a (diff)
downloadmpfr-a6f6e52a85d5fff57b8c05758dfe1edbd0977340.tar.gz
Fix problem on systems where "/dev/null" doesn't exist.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3034 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tout_str.c')
-rw-r--r--tests/tout_str.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/tout_str.c b/tests/tout_str.c
index c9997ce9b..bfa168a85 100644
--- a/tests/tout_str.c
+++ b/tests/tout_str.c
@@ -135,7 +135,12 @@ main (int argc, char *argv[])
/* with no argument: prints to /dev/null,
tout_str N: prints N tests to stdout */
if (argc == 1)
- fout = fopen ("/dev/null", "w");
+ {
+ fout = fopen ("/dev/null", "w");
+ /* If we failed to open this device, try with a dummy file */
+ if (fout == NULL)
+ fout = fopen ("mpfrtest.txt", "w");
+ }
else
{
fout = stdout;