Skip to contentSkip to conversation

thp01: make "true" applet foundable for busybox

PATCH Applied Barry Song 2 participants 2 messages Nov 7, 2012

lore
Share & tools
lore

Barry Song

author
#0 lore raw

PATCH 1/1 thp01: make "true" applet foundable for busybox

Many embedded systems use busybox. busybox only has one binary, so it depends on argv[0] as the applet name to execute right command. in thp01 case, it is "true" command.
this fixes the issue thp01 case always reports "applet not found" for embedded systems and make the case pass on those systems using busybox.
At the same time, this fix doesn't destory the validation of the test case.

---
 testcases/kernel/mem/thp/thp01.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
testcases/kernel/mem/thp/thp01.c +2 -1
index dec6c24..fbb814e 100644
@@ -81,7 +81,8 @@ int main(int argc, char **argv)
 		case 0:
 			memset(arg, 'c', length - 1);
 			arg[length - 1] = '\0';
-			for (i = 0; i < ARRAY_SZ - 1; i++)
+			array[0] = "true";
+			for (i = 1; i < ARRAY_SZ - 1; i++)
 				array[i] = arg;
 			array[ARRAY_SZ - 1] = NULL;
 			if (setrlimit(RLIMIT_STACK, &rl) == -1) {
Signature · 17 lines
1.7.0.4



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Applied
#1 lore raw
Quoted 8 lines · Barry Song

Many embedded systems use busybox. busybox only has one binary, so it depends on argv[0] as the applet name to execute right command. in thp01 case, it is "true" command.
this fixes the issue thp01 case always reports "applet not found" for embedded systems and make the case pass on those systems using busybox.
At the same time, this fix doesn't destory the validation of the test case.

Applied, thank you very much Barry.

Wanlong Gao

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list