From: CAI Q. <ca...@cc...> - 2009-03-16 15:46:35
|
Hi, Version 2 fixes space and tab issues in the previous patch. This patch fixes an error that use the return of the function instead of errno. In addition, errno has been saved first to avoid to be changed by tst_resm(). Signed-off-by: CAI Qian <ca...@cc...> --- testcases/kernel/syscalls/sysconf/sysconf01.c.orig 2009-03-13 18:13:59.000000000 +0800 +++ testcases/kernel/syscalls/sysconf/sysconf01.c 2009-03-13 18:17:34.000000000 +0800 @@ -134,17 +134,18 @@ /* 56 */ { - int retval; + int retval, actual; errno = 0; retval = sysconf(INVAL_FLAG); + actual = errno; if (retval != -1) tst_resm(TFAIL, "sysconf succeeded for invalid flag (%i), retval=%d errno=%d: %s", - INVAL_FLAG, retval, errno, strerror(errno)); - else if (errno != EINVAL) + INVAL_FLAG, retval, actual, strerror(actual)); + else if (actual != EINVAL) tst_resm(TFAIL, "sysconf correctly failed, but expected errno (%i) != actual (%i)\n", - EINVAL, retval); + EINVAL, actual); else tst_resm(TPASS, "using invalid name"); } |