On 02/06/2012 09:57 AM, Wanlong Gao wrote:
> cleanup the code
>
> Signed-off-by: Wanlong Gao <[email protected]>
> ---
[snip]
> +
> + /*
> + * Attempt to mmap using normal pages and
> + * a high memory address
> + */
> addr = mmap(HIGH_ADDR, page_sz, PROT_READ,
> MAP_SHARED | MAP_FIXED, fildes, 0);
> if (addr != MAP_FAILED) {
> - tst_resm(TFAIL, "Normal mmap() into high region
> unexpectedly succeeded on %s, errno=%d : %s",
> - TEMPFILE, errno, strerror(errno));
> + tst_resm(TFAIL|TERRNO, "Normal mmap() into high region"
> + " unexpectedly succeeded on %s, TEMPFILE");
> continue;
> - } else {
> - tst_resm(TPASS, "Normal mmap() into high region failed
> correctly");
> + } else { tst_resm(TPASS, "Normal mmap() into high region" "
> failed correctly");
Hmmm... several returns are missing here.
> break;
> }
>
> @@ -138,24 +120,13 @@ main(int ac, char **av)
> tst_exit();
> }
>
[snip]
>
> -/*
> - * cleanup() - performs all ONE TIME cleanup for this test at
> - * completion or premature exit.
> - * Remove the temporary directory created.
> - */
> -void
> -cleanup()
> +static void cleanup(void)
> {
> /*
> * print timing stats if that option was specified.
And better remove this comment too.
Others look good.
Thanks,
Caspar
> @@ -179,3 +144,8 @@ cleanup()
> unlink(TEMPFILE);
>
> }
> +
> +static void help(void)
> +{
> + printf(" -H /.. Location of hugetlbfs, i.e. -H /var/hugetlbfs\n");
> +}
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list