diff --git a/configure.ac b/configure.ac index ff79698..728a550 100644 --- a/configure.ac +++ b/configure.ac @@ -148,7 +148,7 @@ AC_TYPE_PID_T # Checks for library functions. AC_FUNC_VPRINTF AC_FUNC_MMAP -AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s mkdtemp getopt getopt_long getprogname getexecname rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs lstat]) +AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s mkdtemp getopt getopt_long getprogname getexecname rand random lrand48 random_r rand_r readlink regcomp regerror regexec regfree fstatvfs fstatfs lstat]) dnl AC_CHECK_FUNCS doesn't check for header files. dnl posix_fadvise() may be not available in older libc. diff --git a/src/fcdefault.c b/src/fcdefault.c index c6397c0..4beda7c 100644 --- a/src/fcdefault.c +++ b/src/fcdefault.c @@ -149,7 +149,7 @@ retry: #else # if defined (HAVE_GETEXECNAME) const char *p = getexecname (); -# else +# elif defined (HAVE_READLINK) char buf[PATH_MAX + 1]; int len; char *p = NULL; @@ -160,6 +160,8 @@ retry: buf[len] = '\0'; p = buf; } +# else + char *p = NULL; # endif if (p) {