diff --git a/port/port_posix.h b/port/port_posix.h index 45a9cf3b2a..ff8d4af4b0 100644 --- a/port/port_posix.h +++ b/port/port_posix.h @@ -53,7 +53,7 @@ #if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\ defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\ - defined(OS_ANDROID) + defined(OS_ANDROID) || defined(OS_CYGWIN) // Use fread/fwrite/fflush on platforms without _unlocked variants #define fread_unlocked fread #define fwrite_unlocked fwrite diff --git a/util/env_posix.cc b/util/env_posix.cc index 9b7f13fe19..371dcf15b2 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -186,11 +186,7 @@ class PosixSequentialFile: public SequentialFile { Status s; size_t r = 0; do { -#ifndef CYGWIN r = fread_unlocked(scratch, 1, n, file_); -#else - r = fread(scratch, 1, n, file_); -#endif } while (r == 0 && ferror(file_) && errno == EINTR); IOSTATS_ADD(bytes_read, r); *result = Slice(scratch, r);