[SCM] Samba Shared Repository - branch v3-2-test updated -
initial-v3-2-unstable-245-g7646f4b
Jeremy Allison
jra at samba.org
Fri Nov 9 03:01:04 GMT 2007
The branch, v3-2-test has been updated
via 7646f4b284403c18b22ca5cc7de4a57ba571183e (commit)
from 7a1de5b44e84a7474e78518c6ba33b3fedc42b5f (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 7646f4b284403c18b22ca5cc7de4a57ba571183e
Author: Jeremy Allison <jra at samba.org>
Date: Thu Nov 8 19:00:10 2007 -0800
More pstring/fstring removal.
Jeremy.
-----------------------------------------------------------------------
Summary of changes:
source/lib/util.c | 27 ++++++++++++++++-----------
1 files changed, 16 insertions(+), 11 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/lib/util.c b/source/lib/util.c
index f964395..fd79a7e 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -1434,21 +1434,21 @@ const char *uidtoname(uid_t uid)
char *gidtoname(gid_t gid)
{
- fstring name;
struct group *grp;
grp = getgrgid(gid);
if (grp) {
- fstrcpy(name, grp->gr_name);
+ return talloc_strdup(talloc_tos(), grp->gr_name);
}
else {
- slprintf(name,sizeof(name) - 1, "%d",(int)gid);
+ return talloc_asprintf(talloc_tos(),
+ "%d",
+ (int)gid);
}
- return talloc_strdup(talloc_tos(), name);
}
/*******************************************************************
- Convert a user name into a uid.
+ Convert a user name into a uid.
********************************************************************/
uid_t nametouid(const char *name)
@@ -2466,7 +2466,7 @@ char *state_path(const char *name)
const char *shlib_ext(void)
{
- return dyn_SHLIBEXT;
+ return dyn_SHLIBEXT;
}
/*******************************************************************
@@ -2963,18 +2963,23 @@ struct server_id interpret_pid(const char *pid_string)
char *procid_str(TALLOC_CTX *mem_ctx, const struct server_id *pid)
{
- fstring str;
#ifdef CLUSTER_SUPPORT
if (pid->vnn == NONCLUSTER_VNN) {
- fstr_sprintf(str, "%d", (int)pid->pid);
+ return talloc_asprintf(mem_ctx,
+ "%d",
+ (int)pid->pid);
}
else {
- fstr_sprintf(str, "%u:%d", (unsigned)pid->vnn, (int)pid->pid);
+ return talloc_asprintf(mem_ctx,
+ "%u:%d",
+ (unsigned)pid->vnn,
+ (int)pid->pid);
}
#else
- fstr_sprintf(str, "%d", (int)pid->pid);
+ return talloc_asprintf(mem_ctx,
+ "%d",
+ (int)pid->pid);
#endif
- return talloc_strdup(mem_ctx, str);
}
char *procid_str_static(const struct server_id *pid)
--
Samba Shared Repository
More information about the samba-cvs
mailing list