]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Hurd compilation: Try get_current_dir_name
authorJean-Michel Vourgère <nirgal@debian.org>
Sun, 2 Aug 2015 13:06:57 +0000 (15:06 +0200)
committerJean-Michel Vourgère <nirgal@debian.org>
Sun, 2 Aug 2015 13:19:45 +0000 (15:19 +0200)
when MAXPATH is not available, like on hurd platform.
Thanks Marc Dequènes.

configure.ac
src/rrd_tool.c

index 3fabcf4f4adb7b7a8f032f9345d9fbfd3d808aa0..e802dcf40870583f1c6c8f21300752fb0817d859 100644 (file)
@@ -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
 
index 63df770d260e9964ebe2b11fb33a5940437b4d0e..3e81ce28339f3aed241a56f84fd26c7277baded6 100644 (file)
@@ -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);