Re: [LTP] [PATCH 11/13]Fix the wrong using of perror()

Mike Frysinger
2011-01-06T18:21:46Z

On Thu, Jan 6, 2011 at 6:10 AM, tangchen wrote:
> --- a/testcases/kernel/syscalls/sched_setparam/sched_setparam03.c
> +++ b/testcases/kernel/syscalls/sched_setparam/sched_setparam03.c
> @@ -121,7 +121,8 @@ int main(int ac, char **av)
>              TEST(sched_setparam(getppid(), &param));
>
>              if (TEST_RETURN == -1) {
> -                perror("sched_setparam returned %ld", TEST_RETURN);
> +                fprintf(stderr, "sched_setparam returned %ld: "
> +                    "%s\n", TEST_RETURN, strerror(errno));
>                  exit(0);
>              }
>              exit(1);

odd, this should have caused a compile error ...

also, i wonder why this test isnt using tst_* helpers for its output ...
-mike