From: Garrett C. <su...@li...> - 2011-01-02 01:15:08
|
The branch, master, has been updated via 870d30ec6c9719b48f08e6774ddfba1acd938267 (commit) via fbf7f536d6dc6472a8acafa2083030f424abe378 (commit) via 55535b8815ecaad2753925d418c2d3f4e90150ed (commit) from 42902118fb4f07672c0d13a85a7926e551ede7f0 (commit) - Log ----------------------------------------------------------------- commit 870d30ec6c9719b48f08e6774ddfba1acd938267 Author: Garrett Cooper <yan...@gm...> Date: Thu Dec 16 17:05:15 2010 -0800 Fix bugs with unshare changes. 1. Restore CLONE_FILES as the first testcase as per the source file comments. 2. Add missing exit in child process. Signed-off-by: Bian Naimeng <bi...@cn...> commit fbf7f536d6dc6472a8acafa2083030f424abe378 Author: Garrett Cooper <yan...@gm...> Date: Thu Dec 16 17:04:08 2010 -0800 Remove bogus externs. Signed-off-by: Garrett Cooper <yan...@gm...> commit 55535b8815ecaad2753925d418c2d3f4e90150ed Author: Garrett Cooper <yan...@gm...> Date: Thu Dec 16 16:35:27 2010 -0800 Simplify tst_brkm messages. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/lchown/lchown01.c | 10 ++++------ testcases/kernel/syscalls/unshare/unshare01.c | 11 ++++------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/testcases/kernel/syscalls/lchown/lchown01.c b/testcases/kernel/syscalls/lchown/lchown01.c index 228ecc5..c49e46a 100644 --- a/testcases/kernel/syscalls/lchown/lchown01.c +++ b/testcases/kernel/syscalls/lchown/lchown01.c @@ -209,17 +209,15 @@ void setup(void) TEST_PAUSE; tst_tmpdir(); - if ((fd = open(TESTFILE, O_RDWR | O_CREAT, FILE_MODE)) == -1) { - tst_brkm(TBROK, cleanup, "open(%s, O_RDWR|O_CREAT, %o) failed", - TESTFILE, FILE_MODE); + if ((fd = open(TESTFILE, O_RDWR|O_CREAT, FILE_MODE)) == -1) { + tst_brkm(TBROK, cleanup, "open failed"); } if (close(fd) == -1) { - tst_brkm(TBROK|TERRNO, cleanup, "close(%s) failed", TESTFILE); + tst_brkm(TBROK|TERRNO, cleanup, "close failed"); } if (symlink(TESTFILE, SFILE) < 0) { - tst_brkm(TBROK|TERRNO, cleanup, "symlink(2) %s to %s failed", - TESTFILE, SFILE); + tst_brkm(TBROK|TERRNO, cleanup, "symlink failed"); } } diff --git a/testcases/kernel/syscalls/unshare/unshare01.c b/testcases/kernel/syscalls/unshare/unshare01.c index 041286c..5d18a6d 100644 --- a/testcases/kernel/syscalls/unshare/unshare01.c +++ b/testcases/kernel/syscalls/unshare/unshare01.c @@ -94,14 +94,10 @@ #include "usctest.h" #include "config.h" -/* Extern Global Variables */ -extern int Tst_count; -extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ - /* Global Variables */ char *TCID = "unshare01"; /* Test program identifier.*/ int testno; -int TST_TOTAL =1; /* total number of tests in this file. */ +int TST_TOTAL = 1; /* total number of tests in this file. */ #ifdef HAVE_UNSHARE @@ -174,7 +170,7 @@ int main(int ac, char **av) { if (TEST_RETURN == -1) { tst_brkm(TFAIL|TTERRNO, cleanup, "fork failed"); } else if (TEST_RETURN == 0) { - TEST(unshare(CLONE_FS)); + TEST(unshare(CLONE_FILES)); if (TEST_RETURN == 0) { printf("unshare with CLONE_FILES call " "succeeded\n"); @@ -268,6 +264,7 @@ int main(int ac, char **av) { rval = 2; } } + exit(rval); } else { if (wait(&rval) == -1) { tst_brkm(TBROK|TERRNO, cleanup, @@ -302,4 +299,4 @@ int main(void) tst_resm(TCONF, "unshare is undefined."); tst_exit(); } -#endif \ No newline at end of file +#endif hooks/post-receive -- ltp |