summaryrefslogtreecommitdiffstats
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-02-13 10:56:34 +0100
committerVolker Lendecke <vl@samba.org>2009-02-13 12:15:03 +0100
commit0844cca1d5e4579b54af7d03509f3f97fac43bdc (patch)
tree48e92ab9ebeb54a485394849e3bcc2b0aca7734a /source3/lib/util.c
parente7f7ed8bf6281ef01aca53ea44acdd4af4c51aa7 (diff)
downloadsamba-0844cca1d5e4579b54af7d03509f3f97fac43bdc.tar.gz
samba-0844cca1d5e4579b54af7d03509f3f97fac43bdc.tar.xz
samba-0844cca1d5e4579b54af7d03509f3f97fac43bdc.zip
Replace get_myname() with the talloc version from v3-3-test
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c31
1 files changed, 1 insertions, 30 deletions
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
@@ -1209,35 +1209,6 @@ void add_to_large_array(TALLOC_CTX *mem_ctx, size_t element_size,
}
/****************************************************************************
- 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;
}