[LTP] [PATCH v3] shmget02: check if CONFIG_HUGETLBFS enabled in kernel

Bogdan Lezhepekov bogdan.lezhepekov@suse.com
Wed Aug 4 17:24:51 CEST 2021


Hi Cyril,

Taken a note for future, thanks!

-Bogdan
________________________________
From: Cyril Hrubis <chrubis@suse.cz>
Sent: Wednesday, August 4, 2021 17:39
To: Bogdan Lezhepekov <bogdan.lezhepekov@suse.com>
Cc: ltp@lists.linux.it <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v3] shmget02: check if CONFIG_HUGETLBFS enabled in kernel

Hi!
Pushed with a minor change, thanks.

The inline variable definition is valid on in C99 and we still have to
support old distributions that compile LTP with GNU89 which does not
allow it. I've also changed the type to unsigned in order to avoid a
warning.

Full diff:

diff --git a/testcases/kernel/syscalls/ipc/shmget/shmget02.c b/testcases/kernel/syscalls/ipc/shmget/shmget02.c
index 7856c2b8e..effd33799 100644
--- a/testcases/kernel/syscalls/ipc/shmget/shmget02.c
+++ b/testcases/kernel/syscalls/ipc/shmget/shmget02.c
@@ -110,10 +110,11 @@ static void setup(void)
         pw = SAFE_GETPWNAM("nobody");

         if (!hugetlbfs_supported()) {
+               unsigned int i;

                 tst_res(TINFO, "SHM_HUGETLB not supported by kernel");

-               for (int i = 0; i < ARRAY_SIZE(tcases); i++) {
+               for (i = 0; i < ARRAY_SIZE(tcases); i++) {
                         if (tcases[i].flags & SHM_HUGETLB)
                                 tcases[i].exp_err = EINVAL;
                 }

--
Cyril Hrubis
chrubis@suse.cz

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210804/d934f373/attachment.htm>


More information about the ltp mailing list