From: Subrata <sub...@us...> - 2009-06-09 16:01:24
|
Update of /cvsroot/ltp/ltp/testcases/kernel/containers/sysvipc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1759/ltp/testcases/kernel/containers/sysvipc Modified Files: shmnstest.c Log Message: Test library cleanups: Removing no longer used code from test.h eg. test_error.c is no longer in ltp, and the same for t_res.c so there is no need to include function prototypes for these. Adding void to functions that doesn't take any parameters; tst_exit() -> tst_exit(void); so code that pases parameters to these is not compileable any more. Also fixes all test broken by that change. As parameters passed to tst_exit() are ignored anyway it's quite safe to just remove them; but I'would rather see someone take a closer look. Code cleanups and fixes in tst_res.c: * removed trivial and useless comments, * cleaned coding style, * and much more, TODO: there is much redundant code in tst_res.c I'll eliminate that by static functions. Signed-off-by: ch...@su.... Index: shmnstest.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/containers/sysvipc/shmnstest.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shmnstest.c 20 Oct 2008 06:30:32 -0000 1.5 --- shmnstest.c 9 Jun 2009 16:01:20 -0000 1.6 *************** *** 58,65 **** shmctl(id, IPC_RMID, NULL); } - tst_exit(0); ! /* NOT REACHED */ ! return 0; } --- 58,63 ---- shmctl(id, IPC_RMID, NULL); } ! tst_exit(); } *************** *** 77,81 **** tst_resm(TFAIL, "Usage: %s <clone|unshare|none>\n", argv[0]); tst_resm(TFAIL, " where clone, unshare, or fork specifies unshare method."); ! tst_exit(2); } if (pipe(p1) == -1) { perror("pipe"); exit(EXIT_FAILURE); } --- 75,79 ---- tst_resm(TFAIL, "Usage: %s <clone|unshare|none>\n", argv[0]); tst_resm(TFAIL, " where clone, unshare, or fork specifies unshare method."); ! tst_exit(); } if (pipe(p1) == -1) { perror("pipe"); exit(EXIT_FAILURE); } *************** *** 95,99 **** perror("shmget"); tst_resm(TFAIL, "shmget failed\n"); ! tst_exit(3); } --- 93,97 ---- perror("shmget"); tst_resm(TFAIL, "shmget failed\n"); ! tst_exit(); } *************** *** 103,107 **** if (r < 0) { tst_resm(TFAIL, "%s failed\n", tsttype); ! tst_exit(1); } --- 101,105 ---- if (r < 0) { tst_resm(TFAIL, "%s failed\n", tsttype); ! tst_exit(); } *************** *** 127,133 **** shmctl(id, IPC_RMID, NULL); ! tst_exit(0); ! ! /* NOT REACHED */ ! return 0; } --- 125,128 ---- shmctl(id, IPC_RMID, NULL); ! tst_exit(); } |