From: Tollef Fog Heen Date: Thu, 17 Jul 2008 18:25:03 +0000 (+0200) Subject: Pull gethostbyname from gnulib too X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aacee79e0a36a806a2a4d3b5c47c7395aaaac7d4;p=backuppcd Pull gethostbyname from gnulib too --- diff --git a/configure.ac b/configure.ac index 410668e..ad1d7f8 100644 --- a/configure.ac +++ b/configure.ac @@ -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 index 6365b78..0000000 --- a/gethostname.c +++ /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 index facb729..0000000 --- a/gethostname.h +++ /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