[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fseeko use
From: |
Eric Blake |
Subject: |
fseeko use |
Date: |
Thu, 24 May 2007 05:57:38 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm installing this to both branch and head, now that gnulib guarantees
fseeko will work (beforehand, it was possible for fseek to fail
unnecessarily at 2gb on platforms with larger off_t).
2007-05-24 Eric Blake <address@hidden>
Work around cygwin and mingw fseeko bugs.
* m4/gnulib-cache.m4: Augment with 'gnulib-tool --import fseeko'.
* src/debug.c (debug_flush_files): Prefer fseeko over fseek.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGVX2y84KuGfSFAYARAsveAJ9yoID/YnftHmo/QBgE79kUl+GAOwCeIUIB
xuncTHbGKfddrVf0FBWaOxg=
=k7LO
-----END PGP SIGNATURE-----
Index: m4/gnulib-cache.m4
===================================================================
RCS file: /sources/m4/m4/m4/Attic/gnulib-cache.m4,v
retrieving revision 1.1.2.23
diff -u -p -r1.1.2.23 gnulib-cache.m4
--- m4/gnulib-cache.m4 5 Feb 2007 14:40:00 -0000 1.1.2.23
+++ m4/gnulib-cache.m4 24 May 2007 11:57:10 -0000
@@ -15,11 +15,11 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --lib=libm4 --source-base=lib --m4-base=m4
--doc-base=doc --aux-dir=. --no-libtool --macro-prefix=M4 avltree-oset
binary-io clean-temp cloexec close-stream closeout config-h error fdl
fopen-safer free gendocs getopt gnupload mkstemp obstack regex stdbool stdint
stdlib-safer strtol unlocked-io verror version-etc-fsf xalloc xvasprintf
+# gnulib-tool --import --dir=. --lib=libm4 --source-base=lib --m4-base=m4
--doc-base=doc --aux-dir=. --no-libtool --macro-prefix=M4 avltree-oset
binary-io clean-temp cloexec close-stream closeout config-h error fdl
fopen-safer free fseeko gendocs getopt gnupload mkstemp obstack regex stdbool
stdint stdlib-safer strtol unlocked-io verror version-etc-fsf xalloc xvasprintf
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
-gl_MODULES([avltree-oset binary-io clean-temp cloexec close-stream closeout
config-h error fdl fopen-safer free gendocs getopt gnupload mkstemp obstack
regex stdbool stdint stdlib-safer strtol unlocked-io verror version-etc-fsf
xalloc xvasprintf])
+gl_MODULES([avltree-oset binary-io clean-temp cloexec close-stream closeout
config-h error fdl fopen-safer free fseeko gendocs getopt gnupload mkstemp
obstack regex stdbool stdint stdlib-safer strtol unlocked-io verror
version-etc-fsf xalloc xvasprintf])
gl_AVOID([])
gl_SOURCE_BASE([lib])
gl_M4_BASE([m4])
Index: src/debug.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/debug.c,v
retrieving revision 1.1.1.1.2.11
diff -u -p -r1.1.1.1.2.11 debug.c
--- src/debug.c 1 Nov 2006 22:29:08 -0000 1.1.1.1.2.11
+++ src/debug.c 24 May 2007 11:57:10 -0000
@@ -1,6 +1,6 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1991, 1992, 1993, 1994, 2004, 2006 Free Software
+ Copyright (C) 1991, 1992, 1993, 1994, 2004, 2006, 2007 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -179,7 +179,7 @@ debug_flush_files (void)
opened on a seekable file, that the file pointer be left at the
next character on exit (but places no restrictions on the file
pointer location on a non-seekable file). It also requires that
- fflush() followed by fseek() on an input file set the underlying
+ fflush() followed by fseeko() on an input file set the underlying
file pointer. However, fflush() on a non-seekable file can lose
buffered data, which we might otherwise want to process after
syscmd. Hence, we must check whether stdin is seekable. We must
@@ -188,12 +188,12 @@ debug_flush_files (void)
friends are essential, so that if stdin was closed, this lseek is
not on some other file that we have since opened. Mingw has bugs
when using fseek on text files, so we only strive for POSIX
- behavior when we detect a UNIX environment. */
+ behavior when we detect a UNIX environment, until gnulib is improved. */
#if UNIX
if (lseek (STDIN_FILENO, 0, SEEK_CUR) >= 0
&& fflush (stdin) == 0)
{
- fseek (stdin, 0, SEEK_CUR);
+ fseeko (stdin, 0, SEEK_CUR);
}
#endif /* UNIX */
}
- fseeko use,
Eric Blake <=