]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/interprocess/detail/os_file_functions.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / interprocess / detail / os_file_functions.hpp
index 0eeb26e2bc5cb04e832208c13cfd9b5e15a88b7b..17c5c94b9e71f9da4ae65e15e286cac2d222d919 100644 (file)
@@ -24,9 +24,9 @@
 #include <boost/interprocess/errors.hpp>
 #include <boost/interprocess/permissions.hpp>
 
-#include <string>
-#include <limits>
 #include <climits>
+#include <limits>
+#include <string>
 #include <boost/move/detail/type_traits.hpp> //make_unsigned
 
 #if defined (BOOST_INTERPROCESS_WINDOWS)
@@ -37,9 +37,9 @@
 #     include <unistd.h>
 #     include <sys/types.h>
 #     include <sys/stat.h>
-#     include <errno.h>
-#     include <cstdio>
 #     include <dirent.h>
+#     include <cerrno>
+#     include <cstdio>
 #     if 0
 #        include <sys/file.h>
 #     endif
@@ -167,7 +167,7 @@ inline bool truncate_file (file_handle_t hnd, std::size_t size)
    }
 
    if(offset_t(size) > filesize){
-      if(!winapi::set_file_pointer_ex(hnd, filesize, 0, winapi::file_begin)){
+      if(!winapi::set_file_pointer(hnd, filesize, 0, winapi::file_begin)){
          return false;
       }
       //We will write zeros in the end of the file
@@ -186,7 +186,7 @@ inline bool truncate_file (file_handle_t hnd, std::size_t size)
       }
    }
    else{
-      if(!winapi::set_file_pointer_ex(hnd, size, 0, winapi::file_begin)){
+      if(!winapi::set_file_pointer(hnd, size, 0, winapi::file_begin)){
          return false;
       }
       if(!winapi::set_end_of_file(hnd)){
@@ -200,10 +200,10 @@ inline bool get_file_size(file_handle_t hnd, offset_t &size)
 {  return winapi::get_file_size(hnd, size);  }
 
 inline bool set_file_pointer(file_handle_t hnd, offset_t off, file_pos_t pos)
-{  return winapi::set_file_pointer_ex(hnd, off, 0, (unsigned long) pos); }
+{  return winapi::set_file_pointer(hnd, off, 0, (unsigned long) pos); }
 
 inline bool get_file_pointer(file_handle_t hnd, offset_t &off)
-{  return winapi::set_file_pointer_ex(hnd, 0, &off, winapi::file_current); }
+{  return winapi::set_file_pointer(hnd, 0, &off, winapi::file_current); }
 
 inline bool write_file(file_handle_t hnd, const void *data, std::size_t numdata)
 {
@@ -457,7 +457,7 @@ inline file_handle_t create_or_open_file
    int ret = -1;
    //We need a loop to change permissions correctly using fchmod, since
    //with "O_CREAT only" ::open we don't know if we've created or opened the file.
-   while(1){
+   while(true){
       ret = ::open(name, ((int)mode) | O_EXCL | O_CREAT, perm.get_permissions());
       if(ret >= 0){
          ::fchmod(ret, perm.get_permissions());