]> err.no Git - backuppcd/commitdiff
Pull gethostbyname from gnulib too
authorTollef Fog Heen <tfheen@err.no>
Thu, 17 Jul 2008 18:25:03 +0000 (20:25 +0200)
committerTollef Fog Heen <tfheen@err.no>
Thu, 17 Jul 2008 18:25:03 +0000 (20:25 +0200)
configure.ac
gethostname.c [deleted file]
gethostname.h [deleted file]

index 410668e554b1b054c1f9cb4d1d87eb74b6a59be0..ad1d7f82dbbbe47eb33fc7781b24f08e06cc5f26 100644 (file)
@@ -15,7 +15,7 @@ AC_CHECK_TOOL(AR, ar, true)
 AC_CHECK_HEADERS(stdlib.h string.h unistd.h time.h sys/time.h sys/types.h signal.h syslog.h sys/select.h netinet/in.h arpa/inet.h sys/socket.h ssl.h openssl/ssl.h ssl/ssl.h fcntl.h dirent.h ctype.h assert.h endian.h stdarg.h utime.h fnmatch.h sys/vfs.h sys/statfs.h sys/param.h sys/mount.h sys/resource.h limits.h)
 AC_HEADER_TIME
 AC_CHECK_FUNCS(sysinfo openlog syslog setsid fork fcntl stat lstat lchown symlink readlink signal getenv utime statfs getmntinfo setpriority)
-AC_REPLACE_FUNCS(link gethostname)
+AC_REPLACE_FUNCS(link)
 
 dnl Large file support
 AC_SYS_LARGEFILE
diff --git a/gethostname.c b/gethostname.c
deleted file mode 100644 (file)
index 6365b78..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "compat.h"
-
-/*
- * We may be compiled even if a gethostname() function exists, therefore
- * if we detect that it does exist we should not do anything.
- */
-#ifndef HAVE_GETHOSTNAME
-
-#include "gethostname.h"
-
-int gethostname(char *name, size_t len) {
-       int retval = -1;
-#ifdef _USE_WIN32_
-       BOOL gcn_ret;
-       char *tmpname;
-
-       tmpname = malloc(len);
-
-       gcn_ret = GetComputerName(tmpname, &len);
-       if (gcn_ret) {
-               memcpy(name, tmpname, len);
-               name[len] = '\0';
-
-               retval = 0;
-       }
-
-       free(tmpname);
-#endif
-       return(retval);
-}
-
-#endif
diff --git a/gethostname.h b/gethostname.h
deleted file mode 100644 (file)
index facb729..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef _REPL_GETHOSTBYNAME_H
-#define _REPL_GETHOSTBYNAME_H
-
-#include "compat.h"
-
-#ifndef HOST_NAME_MAX
-#  ifdef _USE_WIN32_
-#    ifdef MAX_COMPUTERNAME_LENGTH
-#      define HOST_NAME_MAX MAX_COMPUTERNAME_LENGTH
-#    endif
-#  else
-#    define HOST_NAME_MAX 255
-#  endif
-#endif
-
-int gethostname(char *name, size_t len);
-
-#endif