BACKPORT: FROMGIT: userfaultfd/selftests: unify error handling

Introduce err()/_err() and replace all the different ways to fail the
program, mostly "fprintf" and "perror" with tons of exit() calls.  Always
stop the test program at any failure.

Link: https://lkml.kernel.org/r/20210310004511.51996-6-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Axel Rasmussen <axelrasmussen@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Nadav Amit <nadav.amit@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

(cherry picked from commit 9cb8fb96f5dbbc736065955c2e3c28ba757828da
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm)
Link: https://lore.kernel.org/patchwork/patch/1392479/
Conflicts:
	tools/testing/selftests/vm/userfaultfd.c

(Manual rebase as 77f962e7ae isn't CP'ed.)

Signed-off-by: Lokesh Gidra <lokeshgidra@google.com>
Bug: 160737021
Bug: 169683130
Change-Id: Ie3b5b330fc68522173d49c023a6390d4a60e4e4f
This commit is contained in:
Peter Xu
2021-03-18 17:01:53 +11:00
committed by Todd Kjos
parent 642412b1ac
commit 606bb05382

File diff suppressed because it is too large Load Diff