From 3c9cae6ca83f7e5ff4abe78ea7b1e94df5c5e250 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 20 Oct 2010 19:59:18 +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 | 6 +++--- sed/utils.c | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1683189..6943925 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-10-20 Paolo Bonzini + + * autoboot.conf: Add fwriting. + * sed/utils.c: Use it. + 2010-08-30 Paolo Bonzini * Makefile.am (dist-hook): Remove COPYRIGHT_YEAR check. diff --git a/autoboot.conf b/autoboot.conf index 88f692e..04182ce 100644 --- a/autoboot.conf +++ b/autoboot.conf @@ -18,9 +18,9 @@ # gnulib modules used by this package. gnulib_modules=" - acl alloca btowc extensions getline getopt gettext localcharset - mbrlen mbrtowc memchr mbsinit mkostemp obstack pathmax rename - selinux-h snprintf stdbool stat-macros strerror strverscmp ssize_t + acl alloca btowc extensions fwriting getline getopt gettext + localcharset mbrlen mbrtowc memchr mbsinit mkostemp obstack pathmax + rename selinux-h snprintf stdbool stat-macros strerror strverscmp ssize_t unlocked-io vasnprintf verify version-etc-fsf wcrtomb wctob" SKIP_PO=t diff --git a/sed/utils.c b/sed/utils.c index 226089a..4839b0a 100644 --- a/sed/utils.c +++ b/sed/utils.c @@ -277,6 +277,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));