[PATCH] xl/parse: mark as GNU source

Jan Beulich posted 1 patch 2 weeks, 3 days ago
Failed in applying to current master (apply log)
[PATCH] xl/parse: mark as GNU source
Posted by Jan Beulich 2 weeks, 3 days ago
Very old glibc (2.4 in the observed case) declares strndup() only when
_GNU_SOURCE is defined.

Fixes: ad860c6454ba ("tools/xl: add xl commands for xenstore quota operations")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This follows what xl_info.c and xl_utils.c already do. Question is whether
instead the Makefile would want to uniformly define _GNU_SOURCE.

--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -12,6 +12,8 @@
  * GNU Lesser General Public License for more details.
  */
 
+#define _GNU_SOURCE
+
 #include <ctype.h>
 #include <inttypes.h>
 #include <limits.h>
Re: [PATCH] xl/parse: mark as GNU source
Posted by Anthony PERARD 2 weeks, 3 days ago
On Wed, May 13, 2026 at 09:37:02AM +0200, Jan Beulich wrote:
> Very old glibc (2.4 in the observed case) declares strndup() only when
> _GNU_SOURCE is defined.
> 
> Fixes: ad860c6454ba ("tools/xl: add xl commands for xenstore quota operations")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Anthony PERARD <anthony.perard@vates.tech>

> ---
> This follows what xl_info.c and xl_utils.c already do. Question is whether
> instead the Makefile would want to uniformly define _GNU_SOURCE.

It would probably be ok to do so.

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech