From 1c7933296b4bf53057c8f3ab4c79635bed225c75 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 10 Feb 2026 09:22:57 +0100 Subject: [PATCH] p2p: Fix build issue with missing _GNU_SOURCE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CC src/p2p.o src/p2p.c: In function ‘p2p_connection_reset’: src/p2p.c:643:17: error: implicit declaration of function ‘explicit_bzero’ [-Wimplicit-function-declaration] 643 | explicit_bzero(dev->conn_pin, strlen(dev->conn_pin)); | ^~~~~~~~~~~~~~ src/p2p.c: In function ‘p2p_device_update_from_genl’: src/p2p.c:4342:23: error: ‘HOST_NAME_MAX’ undeclared (first use in this function); did you mean ‘XATTR_NAME_MAX’? 4342 | char hostname[HOST_NAME_MAX + 1]; | ^~~~~~~~~~~~~ | XATTR_NAME_MAX src/p2p.c:4342:23: note: each undeclared identifier is reported only once for each function it appears in src/p2p.c:4376:9: error: implicit declaration of function ‘gethostname’; did you mean ‘getsockname’? [-Wimplicit-function-declaration] 4376 | gethostname(hostname, sizeof(hostname)); | ^~~~~~~~~~~ | getsockname src/p2p.c:4342:14: error: unused variable ‘hostname’ [-Werror=unused-variable] 4342 | char hostname[HOST_NAME_MAX + 1]; | ^~~~~~~~ --- src/p2p.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p2p.c b/src/p2p.c index 7d89da21..33a4269f 100644 --- a/src/p2p.c +++ b/src/p2p.c @@ -24,6 +24,7 @@ #include #endif +#define _GNU_SOURCE #include #include #include @@ -35,6 +36,7 @@ #include #include #include +#include #include