Deal with some oddities of MSVC's preprocessor
[folly.git] / folly / FileUtil.cpp
index a452644ecf15a67a1fef96322d213de7a4ec3f73..26525debb09a394c74cdd239760f8448443f6861 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -65,7 +65,7 @@ int dup2NoInt(int oldfd, int newfd) {
 int fdatasyncNoInt(int fd) {
 #if defined(__APPLE__)
   return wrapNoInt(fcntl, fd, F_FULLFSYNC);
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(_MSC_VER)
   return wrapNoInt(fsync, fd);
 #else
   return wrapNoInt(fdatasync, fd);
@@ -97,7 +97,7 @@ ssize_t preadNoInt(int fd, void* buf, size_t count, off_t offset) {
 }
 
 ssize_t readvNoInt(int fd, const iovec* iov, int count) {
-  return wrapNoInt(writev, fd, iov, count);
+  return wrapNoInt(readv, fd, iov, count);
 }
 
 ssize_t writeNoInt(int fd, const void* buf, size_t count) {