From: Jean-Michel Vourgère Date: Sun, 2 Aug 2015 13:06:57 +0000 (+0200) Subject: Hurd compilation: Try get_current_dir_name X-Git-Tag: v1.5.4~12^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71bc8365302d0c8b9bf6b7709fb6d47e35bf8b49;p=thirdparty%2Frrdtool-1.x.git Hurd compilation: Try get_current_dir_name when MAXPATH is not available, like on hurd platform. Thanks Marc Dequènes. --- diff --git a/configure.ac b/configure.ac index 3fabcf4f..e802dcf4 100644 --- a/configure.ac +++ b/configure.ac @@ -251,7 +251,7 @@ AC_C_BIGENDIAN dnl for each function found we get a definition in config.h dnl of the form HAVE_FUNCTION -AC_CHECK_FUNCS(nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getgid getuid setgid setuid strndup strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday getpwnam getgrnam) +AC_CHECK_FUNCS(nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getgid getuid setgid setuid strndup strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday getpwnam getgrnam get_current_dir_name) AC_FUNC_STRERROR_R diff --git a/src/rrd_tool.c b/src/rrd_tool.c index 63df770d..3e81ce28 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -595,7 +595,13 @@ int HandleInputLine( printf("ERROR: invalid parameter count for pwd\n"); return (1); } +#ifdef MAXPATH cwd = getcwd(NULL, MAXPATH); +#elif defined(HAVE_GET_CURRENT_DIR_NAME) + cwd = get_current_dir_name(); +#else +#error "You must have either MAXPATH or get_current_dir_name()" +#endif if (cwd == NULL) { printf("ERROR: getcwd %s\n", rrd_strerror(errno)); return (1);