Skip to contentSkip to conversation

Fix bug of unshare

PATCH In review Bian Naimeng 2 participants 2 messages Dec 28, 2010 – Jan 2, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix bug of unshare

Fix two bugs of unshare01.

1. We have test unshare(CLONE_FS) twice, the first one should be CLONE_FILES.
2. Child process forgot to invoke exit, it will cause test fail.

---
 testcases/kernel/syscalls/unshare/unshare01.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
testcases/kernel/syscalls/unshare/unshare01.c +2 -1
index d41edd1..b82777c 100644
@@ -176,7 +176,7 @@ int main(int ac, char **av) {
 				tst_brkm(TFAIL|TTERRNO, cleanup,
 				    "fork() failed.");
 			} else if (TEST_RETURN == 0) {
-				TEST_RETURN = unshare(CLONE_FS);
+				TEST_RETURN = unshare(CLONE_FILES);
 				if (TEST_RETURN == 0) {
 					printf("unshare with CLONE_FILES call "
 					    "succeeded\n");
@@ -268,6 +268,7 @@ int main(int ac, char **av) {
 						rval = 2;
 					}
 				}
+				exit(rval);
 			} else {
 				if (wait(&rval) == -1) {
 					tst_brkm(TBROK|TERRNO, cleanup,
Signature · 20 lines
1.7.0.4




-- 
Regards
Bian Naimeng


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw
Quoted 4 lines · Bian Naimeng

Fix two bugs of unshare01.

1. We have test unshare(CLONE_FS) twice, the first one should be CLONE_FILES.
2. Child process forgot to invoke exit, it will cause test fail.

Thanks!
-Garrett

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list