diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-10-18 09:47:37 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-10-18 09:47:37 +0000 |
commit | a6f6e52a85d5fff57b8c05758dfe1edbd0977340 (patch) | |
tree | 2ac0b1ca16b150862e4919f7bd5f316981ec782a /tests/tout_str.c | |
parent | edae17e3167ac9504ebb12901c186e519242d57a (diff) | |
download | mpfr-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.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; |