* [LTP] [PATCH] controllers/cpuset_lib: Fix compiler error
@ 2018-02-08 6:56 Xiao Yang
2018-02-08 9:17 ` Petr Vorel
0 siblings, 1 reply; 2+ messages in thread
From: Xiao Yang @ 2018-02-08 6:56 UTC (permalink / raw)
To: ltp
Before glibc 2.19, _DEFAULT_SOURCE wasn't added and led to compiler error.
We replace _BSD_SOURCE, _XOPEN_SOURCE and _DEFAULT_SOURCE with _GNU_SOURCE.
Fixes: 78fb665 ("controllers/cpuset: Fix compiler warning")
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c b/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c
index 134a172..172e237 100644
--- a/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c
+++ b/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c
@@ -22,8 +22,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define _XOPEN_SOURCE 500 /* need to see pread() */
-#define _DEFAULT_SOURCE 1 /* need to see syscall() */
+#define _GNU_SOURCE /* need to see pread() and syscall() */
#include <unistd.h>
#include <ctype.h>
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [LTP] [PATCH] controllers/cpuset_lib: Fix compiler error
2018-02-08 6:56 [LTP] [PATCH] controllers/cpuset_lib: Fix compiler error Xiao Yang
@ 2018-02-08 9:17 ` Petr Vorel
0 siblings, 0 replies; 2+ messages in thread
From: Petr Vorel @ 2018-02-08 9:17 UTC (permalink / raw)
To: ltp
Hi Xiao,
> Before glibc 2.19, _DEFAULT_SOURCE wasn't added and led to compiler error.
> We replace _BSD_SOURCE, _XOPEN_SOURCE and _DEFAULT_SOURCE with _GNU_SOURCE.
> Fixes: 78fb665 ("controllers/cpuset: Fix compiler warning")
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
> testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> diff --git a/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c b/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c
> index 134a172..172e237 100644
> --- a/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c
> +++ b/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c
> @@ -22,8 +22,7 @@
> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> */
> -#define _XOPEN_SOURCE 500 /* need to see pread() */
> -#define _DEFAULT_SOURCE 1 /* need to see syscall() */
> +#define _GNU_SOURCE /* need to see pread() and syscall() */
> #include <unistd.h>
> #include <ctype.h>
Thanks for fixing, pushed!
I should have checked it and tested it on old distros myself.
Kind regards,
Petr
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-08 9:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08 6:56 [LTP] [PATCH] controllers/cpuset_lib: Fix compiler error Xiao Yang
2018-02-08 9:17 ` Petr Vorel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.