]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
compat: enable lseek64 alias
authorNoah Watkins <noahwatkins@gmail.com>
Sun, 29 Sep 2013 16:04:37 +0000 (09:04 -0700)
committerNoah Watkins <noahwatkins@gmail.com>
Fri, 20 Dec 2013 23:44:11 +0000 (15:44 -0800)
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
src/include/compat.h
src/os/FileJournal.cc

index f9fd9a6f1f0b5e2928ff6a328f38939ed6264531..dc15533cfda0409e66b684ab80fba84c54342c6f 100644 (file)
@@ -13,7 +13,6 @@
 #define CEPH_COMPAT_H
 
 #if defined(__FreeBSD__)
-#define        lseek64(fd, offset, whence)     lseek(fd, offset, whence)
 #define        ENODATA 61
 #define        MSG_MORE 0
 #endif /* !__FreeBSD__ */
@@ -27,4 +26,8 @@
   __result; })
 #endif
 
+#if defined(__FreeBSD__) || defined(__APPLE__)
+#define lseek64(fd, offset, whence) lseek(fd, offset, whence)
+#endif
+
 #endif /* !CEPH_COMPAT_H */
index b29914e93fb6a019df83976f96cad76f859faaef..eca63846cb90b468ed7959bd6718385cec7a204a 100644 (file)
@@ -1587,11 +1587,7 @@ void FileJournal::wrap_read_bl(
     else
       len = olen;                         // rest
     
-#ifdef DARWIN
-    int64_t actual = ::lseek(fd, pos, SEEK_SET);
-#else
     int64_t actual = ::lseek64(fd, pos, SEEK_SET);
-#endif
     assert(actual == pos);
     
     bufferptr bp = buffer::create(len);
@@ -1795,22 +1791,14 @@ void FileJournal::corrupt(
   if (corrupt_at >= header.max_size)
     corrupt_at = corrupt_at + get_top() - header.max_size;
 
-#ifdef DARWIN
-    int64_t actual = ::lseek(fd, corrupt_at, SEEK_SET);
-#else
     int64_t actual = ::lseek64(fd, corrupt_at, SEEK_SET);
-#endif
     assert(actual == corrupt_at);
 
     char buf[10];
     int r = safe_read_exact(fd, buf, 1);
     assert(r == 0);
 
-#ifdef DARWIN
-    actual = ::lseek(wfd, corrupt_at, SEEK_SET);
-#else
     actual = ::lseek64(wfd, corrupt_at, SEEK_SET);
-#endif
     assert(actual == corrupt_at);
 
     buf[0]++;