userfaultfd: selftest: explicit failure if the SIGBUS test failed

Showing zero in the output isn't very self explanatory as a successful
result.  Show a more explicit error output if the test fails.

Link: http://lkml.kernel.org/r/20170802165145.22628-4-aarcange@redhat.com
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Alexey Perevalov <a.perevalov@samsung.com>
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Andrea Arcangeli 2017-09-06 16:23:49 -07:00 коммит произвёл Linus Torvalds
Родитель 67e803281d
Коммит d312cb1e48
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -987,7 +987,9 @@ static int userfaultfd_sig_test(void)
return 1;
printf("done.\n");
printf(" Signal test userfaults: %ld\n", userfaults);
if (userfaults)
fprintf(stderr, "Signal test failed, userfaults: %ld\n",
userfaults);
close(uffd);
return userfaults != 0;
}