All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markos Chandras <Markos.Chandras@imgtec.com>
To: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 02/21] lib/self_exec: Remove extra argument from tst_resm function call
Date: Tue, 3 Jan 2012 10:40:50 +0000	[thread overview]
Message-ID: <4F02DB32.1050503@imgtec.com> (raw)
In-Reply-To: <4F02D122.7090704@imgtec.com>

[-- Attachment #1: Type: text/plain, Size: 599 bytes --]

On 01/03/2012 09:57 AM, Markos Chandras wrote:
> On 01/03/2012 09:50 AM, Garrett Cooper wrote:
>> On Tue, Jan 3, 2012 at 1:35 AM, Markos Chandras
>> <Markos.Chandras@imgtec.com>   wrote:
>>> Hi, please review the attached patch
>>
>>       Converting the function to tst_brkm and removing the tst_exit call
>> below it would be better.
>> Thanks!
>> -Garrett
> Agreed, but to make this consistent, all the tst_resm&&  tst_exit pairs
> should be replaced with tst_brkm. I will prepare a patch
>
Here is a patch that converts all tst_resm && tst_exit calls to 
tst_brkm. Please review it.

-- 
markos

[-- Attachment #2: 0002-lib-self_exec-Convert-tst_resm-tst_exit-calls-to-tst.patch --]
[-- Type: text/plain, Size: 3082 bytes --]

From 9259c9318e099c84291afaa1de5279dfb26a763d Mon Sep 17 00:00:00 2001
From: Markos Chandras <markos.chandras@imgtec.com>
Date: Thu, 22 Dec 2011 10:43:19 +0000
Subject: [PATCH 02/21] lib/self_exec: Convert tst_resm && tst_exit calls to tst_brkm

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
 lib/self_exec.c |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/lib/self_exec.c b/lib/self_exec.c
index a457468..abbfeb4 100644
--- a/lib/self_exec.c
+++ b/lib/self_exec.c
@@ -86,8 +86,7 @@ maybe_run_child(void (*child)(), char *fmt, ...)
 
 	child_dir = strtok(args, ",");
 	if (strlen(child_dir) == 0) {
-	    tst_resm(TBROK, NULL, "Could not get directory from -C option");
-	    tst_exit();
+	    tst_brkm(TBROK, NULL, "Could not get directory from -C option");
 	}
 
 	va_start(ap, fmt);
@@ -95,8 +94,7 @@ maybe_run_child(void (*child)(), char *fmt, ...)
 	for (p = fmt; *p; p++) {
 	    tok = strtok(NULL, ",");
 	    if (!tok || strlen(tok) == 0) {
-		tst_resm(TBROK, "Invalid argument to -C option");
-		tst_exit();
+		tst_brkm(TBROK, NULL, "Invalid argument to -C option");
 	    }
 
 	    switch (*p) {
@@ -104,8 +102,7 @@ maybe_run_child(void (*child)(), char *fmt, ...)
 		iptr = va_arg(ap, int *);
 		i = strtol(tok, &endptr, 10);
 		if (*endptr != '\0') {
-		    tst_resm(TBROK, "Invalid argument to -C option");
-		    tst_exit();
+		    tst_brkm(TBROK, NULL, "Invalid argument to -C option");
 		}
 		*iptr = i;
 		break;
@@ -113,8 +110,7 @@ maybe_run_child(void (*child)(), char *fmt, ...)
 		j = va_arg(ap, int);
 		i = strtol(tok, &endptr, 10);
 		if (*endptr != '\0') {
-		    tst_resm(TBROK, "Invalid argument to -C option");
-		    tst_exit();
+		    tst_brkm(TBROK, NULL, "Invalid argument to -C option");
 		}
 		if (j != i) {
 		    va_end(ap);
@@ -124,21 +120,18 @@ maybe_run_child(void (*child)(), char *fmt, ...)
 	    case 's':
 		s = va_arg(ap, char *);
 		if (!strncpy(s, tok, strlen(tok)+1)) {
-		    tst_resm(TBROK, "Could not strncpy for -C option");
-		    tst_exit();
+		    tst_brkm(TBROK, NULL, "Could not strncpy for -C option");
 		}
 		break;
 	    case 'S':
 		sptr = va_arg(ap, char **);
 		*sptr = strdup(tok);
 		if (!*sptr) {
-		    tst_resm(TBROK, "Could not strdup for -C option");
-		    tst_exit();
+		    tst_brkm(TBROK, NULL, "Could not strdup for -C option");
 		}
 		break;
 	    default:
-		tst_resm(TBROK, "Format string option %c not implemented", *p);
-		tst_exit();
+		tst_brkm(TBROK, NULL, "Format string option %c not implemented", *p);
 		break;
 	    }
 	}
@@ -146,8 +139,7 @@ maybe_run_child(void (*child)(), char *fmt, ...)
 	va_end(ap);
 
 	if (chdir(child_dir) < 0) {
-	    tst_resm(TBROK, "Could not change to %s for child", child_dir);
-	    tst_exit();
+	    tst_brkm(TBROK, "Could not change to %s for child", child_dir);
 	}
 
 	(*child)();
@@ -215,4 +207,4 @@ self_exec(char *argv0, char *fmt, ...)
     return execlp(argv0, argv0, "-C", arg, (char *) NULL);
 }
 
-#endif /* UCLINUX */
\ No newline at end of file
+#endif /* UCLINUX */
-- 
1.7.1


[-- Attachment #3: Type: text/plain, Size: 355 bytes --]

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2012-01-03 10:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-03  9:35 [LTP] [PATCH 02/21] lib/self_exec: Remove extra argument from tst_resm function call Markos Chandras
2012-01-03  9:50 ` Garrett Cooper
2012-01-03  9:57   ` Markos Chandras
2012-01-03 10:40     ` Markos Chandras [this message]
2012-01-03 18:01       ` Garrett Cooper
2012-01-04 14:20       ` Cyril Hrubis
     [not found]         ` <4F045E94.3060004@imgtec.com>
2012-01-04 15:35           ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F02DB32.1050503@imgtec.com \
    --to=markos.chandras@imgtec.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.