[LTP] [PATCH] lib/tst_tmpdir.c: fix compilation with older kernels

Xiao Yang yangx.jy@cn.fujitsu.com
Tue Feb 14 04:09:29 CET 2017


Compilation fails because of undefined __USE_GNU on RHEL5.11GA.
So we need to define _GNU_SOURCE to make __USE_GNU defined.

This has been broken by commmit:

commit fc0c72a85a9de6a846587855c3c40394a6782616
Author: Cyril Hrubis <chrubis@suse.cz>
Date:   Mon Feb 13 15:35:09 2017 +0100

	lib: Move rmobj() to tst_tmpdir.c

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 lib/tst_tmpdir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tst_tmpdir.c b/lib/tst_tmpdir.c
index 71ca3b9..405d377 100644
--- a/lib/tst_tmpdir.c
+++ b/lib/tst_tmpdir.c
@@ -56,7 +56,7 @@
  *		Neither tst_tmpdir() or tst_rmdir() has a return value.
  *
  *********************************************************/
-
+#define _GNU_SOURCE
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-- 
1.8.3.1





More information about the ltp mailing list