diff options
author | Eric Blake <ebb9@byu.net> | 2009-11-07 16:03:38 -0700 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-11-07 16:12:53 -0700 |
commit | 7becd9d708425924f3a402fdd3c6e18ba2a7e4e3 (patch) | |
tree | f091b94b054f7e0959c6cedb1d3f029e039fa00c /tests/test-fwriting.c | |
parent | 453d6be7ea3ca6792fd28a71ccc0f1107a9239a4 (diff) | |
download | gnulib-7becd9d708425924f3a402fdd3c6e18ba2a7e4e3.tar.gz |
fflush, freadseek: use fseeko, not fseek
Follow our own advice: fseek is not safe to use on large files.
* lib/fflush.c (clear_ungetc_buffer_preserving_position)
(clear_ungetc_buffer): Avoid potential problems on large files.
* lib/freadseek.c (freadseek): Likewise.
* modules/freadseek (Depends-on): Add fseeko.
* modules/fseek (configure.ac): Set a witness.
* tests/test-fflush.c (main): Use fseeko.
* tests/test-fpurge.c (fseek): Disable link warning.
* tests/test-freadable.c (fseek): Likewise.
* tests/test-freading.c (fseek): Likewise.
* tests/test-fseeko.c (fseek): Likewise.
* tests/test-ftell.c (fseek): Likewise.
* tests/test-ftello.c (fseek): Likewise.
* tests/test-fwritable.c (fseek): Likewise.
* tests/test-fwriting.c (fseek): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'tests/test-fwriting.c')
-rw-r--r-- | tests/test-fwriting.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test-fwriting.c b/tests/test-fwriting.c index f2ae068a25..9916b82292 100644 --- a/tests/test-fwriting.c +++ b/tests/test-fwriting.c @@ -1,5 +1,5 @@ /* Test of fwriting() function. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,12 @@ #include <stdio.h> #include <stdlib.h> +/* None of the files accessed by this test are large, so disable the + fseek link warning if we are not using the gnulib fseek module. */ +#if !GNULIB_FSEEK +# undef fseek +#endif + #define ASSERT(expr) \ do \ { \ |