diff options
author | Eric Blake <ebb9@byu.net> | 2007-05-24 03:53:37 +0000 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2007-05-24 03:53:37 +0000 |
commit | cec93e99d19f54c8f310b8290bab9014891530e3 (patch) | |
tree | 07ed392a61939878aa12ef0b271d641255e03186 /tests | |
parent | a3a70ebafd7f2fdc069d43e8a26fc246dd7fe5bb (diff) | |
download | gnulib-cec93e99d19f54c8f310b8290bab9014891530e3.tar.gz |
Fix fseeko/ftello on cygwin 1.5.24.
* doc/functions/fseeko.texi (fseeko): Document the fix.
* doc/functions/ftello.texi (ftello): Document the fix.
* doc/functions/stdin.texi (stdin): Document the cygwin bug.
* doc/functions/stdout.text (stdout): New file.
* doc/functions/stderr.text (stderr): New file.
* doc/gnulib.texi (Function Substitutes): Use new files.
* tests/test-fseeko.c (main): Check for broken fseeko on cygwin
prior to 1.7.0.
* tests/test-ftello.c (main): Likewise for ftello.
* tests/test-fseeko.sh: New file.
* tests/test-ftello.sh: New file.
* modules/fseeko-tests (Makefile.am): Ensure test-fseeko is run
with seekable stdin.
* modules/ftello-tests (Makefile.am): Likewise for test-ftello.
* m4/fseeko.m4 (gl_FUNC_FSEEKO): Detect the cygwin bug.
(gl_REPLACE_FSEEKO): New macro.
* m4/ftello.m4 (gl_FUNC_FTELLO, gl_REPLACE_FTELLO): Likewise.
* modules/fseeko (Files): Distribute fseeko.c.
* modules/ftello (Files): Distribute ftello.c.
* lib/fseeko.c (rpl_fseeko) [__CYGWIN__]: Convert stdin to 64-bit
mode.
* lib/ftello.c (rpl_ftello): New file.
* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Allow replacement of
fseeko, ftello.
(gl_STDIN_LARGE_OFFSET): New macro.
* modules/stdio (Makefile.am): Perform the replacement.
* lib/stdio_.h (rpl_fseeko, rpl_ftello): Define when needed.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-fseeko.c | 6 | ||||
-rwxr-xr-x | tests/test-fseeko.sh | 3 | ||||
-rw-r--r-- | tests/test-ftello.c | 5 | ||||
-rwxr-xr-x | tests/test-ftello.sh | 3 |
4 files changed, 10 insertions, 7 deletions
diff --git a/tests/test-fseeko.c b/tests/test-fseeko.c index 1b4c9e8d1e..198cbfce3d 100644 --- a/tests/test-fseeko.c +++ b/tests/test-fseeko.c @@ -27,8 +27,6 @@ int main () { - off_t pos = fseeko (stdin, (off_t)0, SEEK_CUR); - (void)pos; - - return 0; + /* This test assumes stdin is seekable. */ + return fseeko (stdin, (off_t)0, SEEK_CUR) != 0; } diff --git a/tests/test-fseeko.sh b/tests/test-fseeko.sh new file mode 100755 index 0000000000..d6310c7b9f --- /dev/null +++ b/tests/test-fseeko.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +./test-fseeko${EXEEXT} < "$srcdir/test-fseeko.sh" diff --git a/tests/test-ftello.c b/tests/test-ftello.c index 3feefe147f..f87783fc26 100644 --- a/tests/test-ftello.c +++ b/tests/test-ftello.c @@ -27,8 +27,7 @@ int main () { + /* This test assumes stdin is seekable. */ off_t pos = ftello (stdin); - (void)pos; - - return 0; + return pos < 0; } diff --git a/tests/test-ftello.sh b/tests/test-ftello.sh new file mode 100755 index 0000000000..8774c6e09a --- /dev/null +++ b/tests/test-ftello.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +./test-ftello${EXEEXT} < "$srcdir/test-ftello.sh" |