diff options
Diffstat (limited to 'tests/tout_str.c')
-rw-r--r-- | tests/tout_str.c | 7 |
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; |