[sheepdog] FYI: build error of lib/logger.c on CentOS6

Ryusuke Konishi konishi.ryusuke at lab.ntt.co.jp
Thu Feb 6 05:37:14 CET 2014


Hi Lists,

Matsuo-san found compilation of the current master branch fails with
the following error:

Making all in lib
make[1]: Entering directory `/home/ryusuke/git/sdds/download/sheepdog/lib'
  CC     logger.o
logger.c: In function 'gdb_cmd':
logger.c:746: error: 'ARG_MAX' undeclared (first use in this function)
logger.c:746: error: (Each undeclared identifier is reported only once
logger.c:746: error: for each function it appears in.)
logger.c:746: warning: unused variable 'cmd_str'
logger.c: In function 'sd_backtrace':
logger.c:797: error: 'ARG_MAX' undeclared (first use in this function)
logger.c:797: warning: unused variable 'cmd'
make[1]: *** [logger.o] Error 1
make[1]: Leaving directory `/home/ryusuke/git/sdds/download/sheepdog/lib'
make: *** [all-recursive] Error 1

I found this is caused by a bug of sys/param.h included through
"util.h".

The following patch fixes the issue.

--- /usr/include/sys/param.h.orig       2014-02-06 13:15:30.985095750 +0900
+++ /usr/include/sys/param.h    2014-02-06 13:15:43.409674838 +0900
@@ -28,7 +28,7 @@
 #include <linux/param.h>

 /* The kernel headers defines ARG_MAX.  The value is wrong, though.  */
-#ifndef __undef_ARG_MAX
+#ifdef __undef_ARG_MAX
 # undef ARG_MAX
 # undef __undef_ARG_MAX
 #endif


Regards,
Ryusuke Konishi



More information about the sheepdog mailing list