mirror of https://github.com/facebook/rocksdb.git
Cleaning up CYGWIN define of fread_unlocked to port
Summary: CYGWIN avoided fread_unlocked in a wrong way. Fix it to the standard way. Test Plan: Run tests Reviewers: anthony, kradhakrishnan, IslamAbdelRahman, yhchiang, igor Reviewed By: igor Subscribers: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D42549
This commit is contained in:
parent
26ca893198
commit
5ec829bc4f
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue