X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=folly%2FFileUtil.cpp;h=ce61ad963193d32a35a33dad592d436354454df8;hp=70a8e095f7478e5d5635f80fc97afffd005e2fb6;hb=c5a4f4c8d0097e02c380967fc7a3a2b39bb78a53;hpb=3e107c2eb8fccefd31907f434e7e4fb2b24ad002 diff --git a/folly/FileUtil.cpp b/folly/FileUtil.cpp index 70a8e095..ce61ad96 100644 --- a/folly/FileUtil.cpp +++ b/folly/FileUtil.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2016 Facebook, Inc. + * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,14 +22,16 @@ #include #include #include +#include #include +#include namespace folly { using namespace fileutil_detail; int openNoInt(const char* name, int flags, mode_t mode) { - return wrapNoInt(open, name, flags, mode); + return int(wrapNoInt(open, name, flags, mode)); } int closeNoInt(int fd) { @@ -50,41 +52,41 @@ int closeNoInt(int fd) { } int fsyncNoInt(int fd) { - return wrapNoInt(fsync, fd); + return int(wrapNoInt(fsync, fd)); } int dupNoInt(int fd) { - return wrapNoInt(dup, fd); + return int(wrapNoInt(dup, fd)); } int dup2NoInt(int oldfd, int newfd) { - return wrapNoInt(dup2, oldfd, newfd); + return int(wrapNoInt(dup2, oldfd, newfd)); } int fdatasyncNoInt(int fd) { #if defined(__APPLE__) - return wrapNoInt(fcntl, fd, F_FULLFSYNC); + return int(wrapNoInt(fcntl, fd, F_FULLFSYNC)); #elif defined(__FreeBSD__) || defined(_MSC_VER) - return wrapNoInt(fsync, fd); + return int(wrapNoInt(fsync, fd)); #else - return wrapNoInt(fdatasync, fd); + return int(wrapNoInt(fdatasync, fd)); #endif } int ftruncateNoInt(int fd, off_t len) { - return wrapNoInt(ftruncate, fd, len); + return int(wrapNoInt(ftruncate, fd, len)); } int truncateNoInt(const char* path, off_t len) { - return wrapNoInt(truncate, path, len); + return int(wrapNoInt(truncate, path, len)); } int flockNoInt(int fd, int operation) { - return wrapNoInt(flock, fd, operation); + return int(wrapNoInt(flock, fd, operation)); } int shutdownNoInt(int fd, int how) { - return wrapNoInt(portability::sockets::shutdown, fd, how); + return int(wrapNoInt(portability::sockets::shutdown, fd, how)); } ssize_t readNoInt(int fd, void* buf, size_t count) { @@ -233,4 +235,4 @@ void writeFileAtomic( writeFileAtomic(filename, ByteRange(data), permissions); } -} // namespaces +} // namespace folly