From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Wang Date: Tue, 9 Jun 2020 20:55:49 +0800 Subject: [LTP] [PATCH V4 06/17] syscalls/futex: Add support for time64 tests In-Reply-To: References: Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it On Fri, May 22, 2020 at 6:53 PM Viresh Kumar wrote: > ... > diff --git a/testcases/kernel/syscalls/futex/futex_wake04.c > b/testcases/kernel/syscalls/futex/futex_wake04.c > index f92bda53f6c7..edbb9c644c57 100644 > --- a/testcases/kernel/syscalls/futex/futex_wake04.c > +++ b/testcases/kernel/syscalls/futex/futex_wake04.c > ... > > static void wakeup_thread2(void) > { > + struct test_variants *tv = &variants[tst_variant]; > void *addr; > int hpsz, pgsz, res; > pthread_t th1, th2; > > hpsz = read_hugepagesize(); > - tst_resm(TINFO, "Hugepagesize %i", hpsz); > + tst_res(TINFO, "Hugepagesize %i", hpsz); > > /*allocate some shared memory*/ > addr = mmap(NULL, hpsz, PROT_WRITE | PROT_READ, > MAP_SHARED | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0); > > if (addr == MAP_FAILED) { > - if (errno == ENOMEM) { > - tst_brkm(TCONF, NULL, > - "Cannot allocate hugepage, memory too > fragmented?"); > - } > + if (errno == ENOMEM) > + tst_res(TCONF, "Cannot allocate hugepage, memory > too fragmented?"); > Here we can use tst_brk(TCONF, ...), otherwise, the if condition will out of action for ENOMEM. - tst_brkm(TBROK | TERRNO, NULL, "Cannot allocate hugepage"); > + tst_res(TFAIL | TERRNO, "Cannot allocate hugepage"); > + return; > tst_brk(TBROK | TERRNO, ...) -- Regards, Li Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: