[LTP] [PATCH] pidns05: Use tst_getpid()
Cyril Hrubis
chrubis@suse.cz
Fri Sep 22 14:13:50 CEST 2023
Hi!
> --- a/testcases/kernel/containers/pidns/pidns05.c
> +++ b/testcases/kernel/containers/pidns/pidns05.c
> @@ -28,7 +28,7 @@ static void child_func(int *level)
> {
> pid_t cpid, ppid;
>
> - cpid = getpid();
> + cpid = tst_getpid();
> ppid = getppid();
>
> TST_EXP_EQ_LI(cpid, 1);
> @@ -55,7 +55,7 @@ static int find_cinit_pids(pid_t *pids)
> int next = 0;
> pid_t parentpid, pgid, pgid2;
>
> - parentpid = getpid();
> + parentpid = tst_getpid();
I suppose that this one is not strictly required, but it does not harm
to consistently use tst_getpid()
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list