]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix FTBFS on alpha due to incorrect check on BLKGETSIZE
authorDmitry Smirnov <onlyjob@member.fsf.org>
Sat, 23 Aug 2014 12:41:30 +0000 (22:41 +1000)
committerGreg Farnum <greg@inktank.com>
Tue, 2 Sep 2014 17:26:16 +0000 (10:26 -0700)
Ceph FTBFS on Alpha with:

~~~~
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -D_GNU_SOURCE -DCEPH_LIBDIR=\"/usr/lib/alpha-linux-gnu\" -DCEPH_PKGLIBDIR=\"/usr/lib/alpha-linux-gnu/ceph\" -DGTEST_HAS_TR1_TUPLE=0 -D_FORTIFY_SOURCE=2 -I/usr/include/nss -I/usr/include/nspr -Wall -Wtype-limits -Wignored-qualifiers -Winit-self -Wpointer-arith -Werror=format-security -fno-strict-aliasing -fsigned-char -rdynamic -ftemplate-depth-1024 -Wnon-virtual-dtor -Wno-invalid-offsetof -Wstrict-null-sentinel -g -O2 -Wformat -Werror=format-security -c common/blkdev.cc  -fPIC -DPIC -o common/.libs/blkdev.o
In file included from /usr/include/alpha-linux-gnu/asm/ioctls.h:4:0,
                 from /usr/include/alpha-linux-gnu/bits/ioctls.h:23,
                 from /usr/include/alpha-linux-gnu/sys/ioctl.h:26,
                 from common/blkdev.cc:3:
common/blkdev.cc:13:7: error: missing binary operator before token "int"
 #elif BLKGETSIZE
       ^
~~~~

This error occurs because the value of BLKGETSIZE is tested in a
c-preprocessor conditional compilation test whereas the test should
be for existence.

From: Michael Cree <mcree@orcon.net.nz>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756892
Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
(cherry picked from commit 6ad8e61a428cfc9fc60ccdb9bce812e1f49822ac)
Reviewed-by: Greg Farnum <greg@inktank.com>
src/common/blkdev.cc

index 9c7240c0aac6c87ffeae82d5a075f61c639135bc..8b19abb2c4f042758471ed500a1407a2959b871f 100644 (file)
@@ -10,7 +10,7 @@ int get_block_device_size(int fd, int64_t *psize)
 {
 #ifdef BLKGETSIZE64
   int ret = ::ioctl(fd, BLKGETSIZE64, psize);
-#elif BLKGETSIZE
+#elif defined(BLKGETSIZE)
   unsigned long sectors = 0;
   int ret = ::ioctl(fd, BLKGETSIZE, &sectors);
   *psize = sectors * 512ULL;