----- Original Message -----
> From: "Zeng Linggang" <zenglg...@cn.fujitsu.com>
> To: "ltp-list" <ltp-list@lists.sourceforge.net>
> Sent: Tuesday, 22 April, 2014 11:40:13 AM
> Subject: [LTP] [PATCH 1/2] sbrk/sbrk01.c: cleanup
>
> * Delete some useless commtents.
> * Move the test body from main() to sbrk_verify().
> * Remove tst_tmpdir().
> * Some cleanup.
>
> Signed-off-by: Zeng Linggang <zenglg...@cn.fujitsu.com>
> ---
> testcases/kernel/syscalls/sbrk/sbrk01.c | 236
> +++++++-------------------------
> 1 file changed, 52 insertions(+), 184 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/sbrk/sbrk01.c
> b/testcases/kernel/syscalls/sbrk/sbrk01.c
> index b2db42c..f2b09f4 100644
> --- a/testcases/kernel/syscalls/sbrk/sbrk01.c
> +++ b/testcases/kernel/syscalls/sbrk/sbrk01.c
...
>
> -/***************************************************************
> - * setup() - performs all ONE TIME setup for this test.
> - ***************************************************************/
> -void setup(void)
> +static void sbrk_verify(const struct test_case_t *test)
> {
> + void *tret;
>
> - tst_sig(NOFORK, DEF_HANDLER, cleanup);
> -
> - TEST_PAUSE;
> + tret = sbrk(test->increment);
> + TEST_ERRNO = errno;
>
> - /* make a temp dir and cd to it */
> - tst_tmpdir();
> + if (tret == (void *)-1) {
> + tst_resm(TFAIL | TTERRNO,
> + "sbrk - Increase by %ld bytes failed, errno=%d : %s",
> + test->increment, TEST_ERRNO, strerror(TEST_ERRNO));
This looks redundant. You are using TTERRNO and also printing TEST_ERRNO as
decimal
and string again. You could just use TERRNO, errno shouldn't change between
call to sbrk() and if condition.
Regards,
Jan
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list