[LTP] [RFC PATCH 6/8] hugetlb: Fix linking error with -fno-common

Petr Vorel pvorel@suse.cz
Wed Apr 15 11:28:07 CEST 2020


Adding missing extern.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/mem/hugetlb/lib/hugetlb.c | 2 ++
 testcases/kernel/mem/hugetlb/lib/hugetlb.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/mem/hugetlb/lib/hugetlb.c b/testcases/kernel/mem/hugetlb/lib/hugetlb.c
index cd1b27eb3..4bb2d500e 100644
--- a/testcases/kernel/mem/hugetlb/lib/hugetlb.c
+++ b/testcases/kernel/mem/hugetlb/lib/hugetlb.c
@@ -39,6 +39,8 @@
 #include <pwd.h>
 #include "hugetlb.h"
 
+key_t shmkey;
+
 /*
  * getipckey() - generates and returns a message key used by the "get"
  *		 calls to create an IPC resource.
diff --git a/testcases/kernel/mem/hugetlb/lib/hugetlb.h b/testcases/kernel/mem/hugetlb/lib/hugetlb.h
index 88890ebfb..f75109f3e 100644
--- a/testcases/kernel/mem/hugetlb/lib/hugetlb.h
+++ b/testcases/kernel/mem/hugetlb/lib/hugetlb.h
@@ -34,7 +34,7 @@
  */
 #define MODE_MASK	0x01FF
 
-key_t shmkey;			/* an IPC key generated by ftok() */
+extern key_t shmkey;			/* an IPC key generated by ftok() */
 
 int getipckey(void);
 int getuserid(char *user);
-- 
2.26.0



More information about the ltp mailing list