[OpenWrt-Devel] [PATCH] sysupgrade: Add missing _GNU_SOURCE define
Rosen Penev
rosenp at gmail.com
Mon Aug 26 18:22:15 EDT 2019
Fixes compilation problem:
error: implicit declaration of function 'asprintf'; did you mean 'vsprintf'?
[-Werror=implicit-function-declaration]
57 | if (asprintf(&name, "%s%s", prefix, blobmsg_name(option)) <= 0)
| ^~~~~~~~
| vsprintf
Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
sysupgrade.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sysupgrade.c b/sysupgrade.c
index a5bad9a..7f3bbe8 100644
--- a/sysupgrade.c
+++ b/sysupgrade.c
@@ -17,10 +17,13 @@
#include "watchdog.h"
#include "sysupgrade.h"
-#include <ctype.h>
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <ctype.h>
#include <libubox/blobmsg.h>
--
2.17.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list