From 09aaccc9e9d802b03dc5ab3814841f06effc133d Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 29 Sep 2014 19:14:57 +0200 Subject: [PATCH] Uses an extended error report for FlushFileBuffers(). This is at now safer than ignoring the INVALID_HANDLE error. --- cmdline/mingw.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cmdline/mingw.c b/cmdline/mingw.c index 48a1c2e6..52b3891f 100644 --- a/cmdline/mingw.c +++ b/cmdline/mingw.c @@ -818,12 +818,18 @@ int windows_fsync(int fd) * FlushFileBuffers returns this error if the handle * doesn't support buffering, like the console output. * - * We had report also for ATA-over-Ethernet reporting this - * error. + * We had a report that also ATA-over-Ethernet returns + * this * error, but not enough sure to ignore it. + * So, we use now an extended error reporting. */ - return 0; + fprintf(stderr, "Unexpected Windows INVALID_HANDLE error in FlushFileBuffers().\n"); + fprintf(stderr, "Are you using ATA-over-Ethernet ? Please report it.\n"); - case ERROR_ACCESS_DENIED + /* normal error processing */ + windows_errno(error); + return -1; + + case ERROR_ACCESS_DENIED : /* * FlushFileBuffers returns this error for read-only * data, that cannot have to be flushed.