From 0844cca1d5e4579b54af7d03509f3f97fac43bdc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 13 Feb 2009 10:56:34 +0100 Subject: Replace get_myname() with the talloc version from v3-3-test --- source3/lib/util.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'source3/lib/util.c') diff --git a/source3/lib/util.c b/source3/lib/util.c index 68d33224361..6079e710633 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1208,35 +1208,6 @@ void add_to_large_array(TALLOC_CTX *mem_ctx, size_t element_size, *array_size = -1; } -/**************************************************************************** - Get my own name and IP. -****************************************************************************/ - -char *talloc_get_myname(TALLOC_CTX *ctx) -{ - char *p; - char hostname[HOST_NAME_MAX]; - - *hostname = 0; - - /* get my host name */ - if (gethostname(hostname, sizeof(hostname)) == -1) { - DEBUG(0,("gethostname failed\n")); - return False; - } - - /* Ensure null termination. */ - hostname[sizeof(hostname)-1] = '\0'; - - /* split off any parts after an initial . */ - p = strchr_m(hostname,'.'); - if (p) { - *p = 0; - } - - return talloc_strdup(ctx, hostname); -} - /**************************************************************************** Get my own domain name, or "" if we have none. ****************************************************************************/ @@ -2237,7 +2208,7 @@ char *myhostname(void) if (ret == NULL) { /* This is cached forever so * use talloc_autofree_context() ctx. */ - ret = talloc_get_myname(talloc_autofree_context()); + ret = get_myname(talloc_autofree_context()); } return ret; } -- cgit