1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-18 17:57:55 +03:00

r13358: removed some unused functions and make some local functions static

(This used to be commit a73b76a36a70703738945d42795da6cf90c85105)
This commit is contained in:
Andrew Tridgell 2006-02-05 23:13:44 +00:00 committed by Gerald (Jerry) Carter
parent 5972e01163
commit 00c0545665

View File

@ -131,22 +131,10 @@ BOOL directory_create_or_exist(const char *dname, uid_t uid,
}
/*******************************************************************
Returns the size in bytes of the named file.
********************************************************************/
off_t get_file_size(char *file_name)
{
struct stat buf;
buf.st_size = 0;
if(stat(file_name,&buf) != 0)
return (off_t)-1;
return(buf.st_size);
}
/*******************************************************************
Close the low 3 fd's and open dev/null in their place.
********************************************************************/
void close_low_fds(BOOL stderr_too)
static void close_low_fds(BOOL stderr_too)
{
#ifndef VALGRIND
int fd;
@ -407,17 +395,6 @@ BOOL is_zero_ip(struct ipv4_addr ip)
return ip.addr == 0;
}
/*******************************************************************
Set an IP to 0.0.0.0.
******************************************************************/
void zero_ip(struct ipv4_addr *ip)
{
*ip = sys_inet_makeaddr(0,0);
return;
}
/*******************************************************************
Are two IPs on the same subnet?
********************************************************************/
@ -591,37 +568,6 @@ void *memdup(const void *p, size_t size)
return p2;
}
/*****************************************************************
Get local hostname and cache result.
*****************************************************************/
char *myhostname(TALLOC_CTX *mem_ctx)
{
char *myname, *ret;
myname = get_myname();
ret = talloc_strdup(mem_ctx, myname);
free(myname);
return ret;
}
/**********************************************************************
Converts a name to a fully qalified domain name.
***********************************************************************/
char *name_to_fqdn(TALLOC_CTX *mem_ctx, const char *name)
{
struct hostent *hp = sys_gethostbyname(name);
if ( hp && hp->h_name && *hp->h_name ) {
DEBUG(10,("name_to_fqdn: lookup for %s -> %s.\n", name, hp->h_name));
return talloc_strdup(mem_ctx, hp->h_name);
} else {
DEBUG(10,("name_to_fqdn: lookup for %s failed.\n", name));
return talloc_strdup(mem_ctx, name);
}
}
/*****************************************************************
A useful function for returning a path in the Samba lock directory.
*****************************************************************/
@ -653,7 +599,7 @@ char *lock_path(TALLOC_CTX* mem_ctx, const char *name)
/*****************************************************************
A useful function for returning a path in the Samba piddir directory.
*****************************************************************/
char *pid_path(TALLOC_CTX* mem_ctx, const char *name)
static char *pid_path(TALLOC_CTX* mem_ctx, const char *name)
{
char *fname, *dname;
@ -732,7 +678,7 @@ char *smbd_tmp_path(TALLOC_CTX *mem_ctx, const char *name)
return fname;
}
char *modules_path(TALLOC_CTX* mem_ctx, const char *name)
static char *modules_path(TALLOC_CTX* mem_ctx, const char *name)
{
return talloc_asprintf(mem_ctx, "%s/%s", dyn_MODULESDIR, name);
}