Skip to contentSkip to conversation

lib/self_exec: Remove extra argument from tst_resm function call

PATCH In review Markos Chandras 3 participants 7 messages Jan 3, 2012 – Jan 4, 2012 1 message not in the archive Library code

lore
Share & tools
lore
#0 lore raw

PATCH 2/21 lib/self_exec: Remove extra argument from tst_resm function call

Hi, please review the attached patch

Signature · 1 line
markos

From 84228a0a49b1d2bbb256f71bd532ef3572b88b3a Mon Sep 17 00:00:00 2001
From: Markos Chandras <[email protected]>
Date: Thu, 22 Dec 2011 10:43:19 +0000
Subject: [PATCH 02/21] lib/self_exec: Remove extra argument from tst_resm function call

---
 lib/self_exec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/self_exec.c +1 -1
index a457468..c918e70 100644
@@ -86,7 +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_resm(TBROK, "Could not get directory from -C option");
 	    tst_exit();
 	}
 
Signature · 1 line
1.7.1

------------------------------------------------------------------------------
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

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 1 line · Markos Chandras

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

------------------------------------------------------------------------------
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
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
Quoted 8 lines · Garrett Cooper
Quoted 1 line · Markos Chandras

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

Signature · 13 lines
markos


------------------------------------------------------------------------------
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
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#3 lore raw
Quoted 12 lines · Markos Chandras
Quoted 8 lines · Garrett Cooper
Quoted 1 line · Markos Chandras

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.

Signature · 1 line
markos

From 9259c9318e099c84291afaa1de5279dfb26a763d Mon Sep 17 00:00:00 2001
From: Markos Chandras <[email protected]>
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

---
 lib/self_exec.c |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)
lib/self_exec.c +9 -17
index a457468..abbfeb4 100644
@@ -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 */
Signature · 1 line
1.7.1

------------------------------------------------------------------------------
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

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reviewed-by
#4 lore raw
Quoted 13 lines · Markos Chandras
Quoted 12 lines · Markos Chandras
Quoted 9 lines · Garrett Cooper
Quoted 2 lines · Markos Chandras

Hi, please review the attached patch

     Converting the function to tst_brkm and removing the tst_exit call below it would be better.

Quoted 6 lines
Quoted 4 lines

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.

Looks ok!

Thanks!
-Garrett

------------------------------------------------------------------------------
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
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#5 lore raw
In reply to Markos Chandras

Hi!

Quoted 10 lines · Markos Chandras
Quoted 9 lines · Garrett Cooper
Quoted 8 lines
Quoted 1 line · Markos Chandras

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

Quoted 5 lines
Quoted 3 lines

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.

Commited, thanks.

And please add better patch description next time.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

Hi!

Quoted 11 lines

Thanks. I will next time. However, I think there is a problem with the patch now that I had some time to look at in again. The last chunk is wrong. This statement

lib/self_exec.c +1 -0
+	    tst_brkm(TBROK, "Could not change to %s for child", child_dir);

should be

(quoted diff) +1 -0
+	    tst_brkm(TBROK, NULL, "Could not change to %s for child", child_dir);

Could you please commit this fix as well?

Will do, but please send a patch next time.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list