From: Dmitry V. Levin Date: Mon, 4 Jan 2016 23:47:59 +0000 (+0000) Subject: tests/umount2.c: use libtests X-Git-Tag: v4.12~761 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa8d4491e3837a6b8a146442496a416146e9afeb;p=strace tests/umount2.c: use libtests * tests/umount2.c (main): Use perror_msg_and_fail. --- diff --git a/tests/umount2.c b/tests/umount2.c index bb415960..45ed1a44 100644 --- a/tests/umount2.c +++ b/tests/umount2.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2016 Dmitry V. Levin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,6 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "tests.h" #include #include #include @@ -42,14 +43,13 @@ int main(void) { static const char sample[] = "umount2.sample"; - if (mkdir(sample, 0700)) { - perror(sample); - return 77; - } + if (mkdir(sample, 0700)) + perror_msg_and_fail("mkdir: %s", sample); (void) syscall(__NR_umount2, sample, 31); printf("%s(\"%s\", MNT_FORCE|MNT_DETACH|MNT_EXPIRE|UMOUNT_NOFOLLOW|0x10)" " = -1 EINVAL (%m)\n", TEST_SYSCALL_STR, sample); - (void) rmdir(sample); + if (rmdir(sample)) + perror_msg_and_fail("rmdir: %s", sample); puts("+++ exited with 0 +++"); return 0; }