From 5f4693d8f8cf435cb2c62787ba95acf2b0b5f7d2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 8 Nov 2007 18:50:07 -0800 Subject: Remove more pstring/fstrings. Jeremy. (This used to be commit 7a1de5b44e84a7474e78518c6ba33b3fedc42b5f) --- source3/torture/rpctorture.c | 5 +++-- source3/torture/torture.c | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'source3/torture') diff --git a/source3/torture/rpctorture.c b/source3/torture/rpctorture.c index d8fcedd8de..64e7b580f3 100644 --- a/source3/torture/rpctorture.c +++ b/source3/torture/rpctorture.c @@ -228,6 +228,7 @@ enum client_action int nprocs = 1; int numops = 100; pstring logfile; + TALLOC_CTX *frame = talloc_stackframe(); struct client_info cli_info; @@ -292,8 +293,8 @@ enum client_action setup_logging(pname, True); - if (!get_myname(global_myname)) - { + global_myname = get_myname(global_myname); + if (!global_myname) { fprintf(stderr, "Failed to get my hostname.\n"); } diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 697d87adc7..88711ef677 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -5175,6 +5175,7 @@ static void usage(void) int gotuser = 0; int gotpass = 0; bool correct = True; + TALLOC_CTX *frame = talloc_stackframe(); dbf = x_stdout; @@ -5207,7 +5208,11 @@ static void usage(void) *p = 0; fstrcpy(share, p+1); - get_myname(myname); + fstrcpy(myname, get_myname(talloc_tos())); + if (!*myname) { + fprintf(stderr, "Failed to get my hostname.\n"); + return 1; + } if (*username == 0 && getenv("LOGNAME")) { fstrcpy(username,getenv("LOGNAME")); @@ -5309,6 +5314,8 @@ static void usage(void) } } + TALLOC_FREE(frame); + if (correct) { return(0); } else { -- cgit