From 30b44d95a2684bf8226b95fcf48118d7589bc7c2 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 20 Oct 2010 19:57:31 +0200 Subject: [PATCH] fix lseek errors from flushing input pipes on interix 2010-10-20 Paolo Bonzini * autoboot.conf: Add fwriting. * sed/utils.c: Use it. --- ChangeLog | 5 +++++ autoboot.conf | 4 ++-- sed/utils.c | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30b69ff..80cb3e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-10-20 Paolo Bonzini + + * autoboot.conf: Add fwriting. + * sed/utils.c: Use it. + 2010-09-20 Paolo Bonzini * doc/configure.ac: Mention bug-sed@gnu.org. diff --git a/autoboot.conf b/autoboot.conf index 56f5283..794df67 100644 --- a/autoboot.conf +++ b/autoboot.conf @@ -18,8 +18,8 @@ # gnulib modules used by this package. gnulib_modules=" - acl alloca btowc c-ctype extensions getline getopt gettext localcharset - mbrlen mbrtowc mbsinit memchr mkostemp obstack pathmax regex + acl alloca btowc c-ctype extensions fwriting getline getopt gettext + localcharset mbrlen mbrtowc mbsinit memchr mkostemp obstack pathmax regex rename selinux-h stdbool stat-macros ssize_t strerror strverscmp unlocked-io verify version-etc-fsf wcrtomb wctob" diff --git a/sed/utils.c b/sed/utils.c index d5722f6..4212013 100644 --- a/sed/utils.c +++ b/sed/utils.c @@ -278,6 +278,9 @@ void ck_fflush(stream) FILE *stream; { + if (!fwriting(stream)) + return; + clearerr(stream); if (fflush(stream) == EOF && errno != EBADF) panic("couldn't flush %s: %s", utils_fp_name(stream), strerror(errno));