]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
some systems don't have gethostname() ....
authorAndrew Tridgell <tridge@samba.org>
Fri, 7 Mar 2003 12:09:19 +0000 (13:09 +0100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 7 Mar 2003 12:09:19 +0000 (13:09 +0100)
ccache.c
config.h.in
configure
configure.in

index bef9d082bf201022e0f235e24ed6a6223ed58d89..eef28a5af2a7cdebd8a50dc1d82f22627c5fbca2 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -128,7 +128,9 @@ static const char *tmp_string(void)
        if (!ret) {
                char hostname[200];
                strcpy(hostname, "unknown");
+#if HAVE_GETHOSTNAME
                gethostname(hostname, sizeof(hostname)-1);
+#endif
                hostname[sizeof(hostname)-1] = 0;
                asprintf(&ret, "%s.%u", hostname, (unsigned)getpid());
        }
index 74d6f298f236cdfb205b764bc258a0ebd856ccb6..286f0385c3baba4e7ac534763e2aa7792785dea1 100644 (file)
@@ -16,6 +16,9 @@
    */
 #undef HAVE_DIRENT_H
 
+/* Define to 1 if you have the `gethostname' function. */
+#undef HAVE_GETHOSTNAME
+
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
index 5ef7df74383cef6f57490d4ed1cb751e2cceb4bf..4eea3b87664d9ad38c5912a6bc4cb3d58786fabc 100755 (executable)
--- a/configure
+++ b/configure
@@ -3269,7 +3269,8 @@ done
 
 
 
-for ac_func in realpath snprintf vsnprintf vasprintf asprintf mkstemp
+
+for ac_func in realpath snprintf vsnprintf vasprintf asprintf mkstemp gethostname
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
index 8ae73b32eb28f03fc2c390a8571dc162a40f9820..5f591090e068413f23c3dfaa9fff1d2d6bfa2c2e 100644 (file)
@@ -29,7 +29,7 @@ AC_HEADER_SYS_WAIT
 
 AC_CHECK_HEADERS(ctype.h strings.h stdlib.h string.h)
 
-AC_CHECK_FUNCS(realpath snprintf vsnprintf vasprintf asprintf mkstemp)
+AC_CHECK_FUNCS(realpath snprintf vsnprintf vasprintf asprintf mkstemp gethostname)
 
 AC_CACHE_CHECK([for compar_fn_t in stdlib.h],ccache_cv_COMPAR_FN_T, [
     AC_TRY_COMPILE(