On Thu, Feb 13, 2014 at 05:03:12PM +0800, Robin Dong wrote: > From: Robin Dong <sanbai at taobao.com> > > When build sheepdog in centos6, it will report: > > 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’ > > the reason has been explained here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518858 > and the standard revolution is using 'sysconf()'. > > Signed-off-by: Robin Dong <sanbai at taobao.com> > --- > lib/logger.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lib/logger.c b/lib/logger.c > index 8be2bfd..267b87d 100644 > --- a/lib/logger.c > +++ b/lib/logger.c > @@ -741,6 +741,8 @@ static bool check_gdb(void) > return system("which gdb > /dev/null") == 0; > } > > +#define ARG_MAX (sysconf(_SC_ARG_MAX)) > + ARG_MAX is actually defined correctly on my ubuntu 13.04. I'd suggest name it as SD_ARG_MAX. Thanks Yuan |