($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Clayton Craft <clayton@craftyguy.net>
To: iwd@lists.linux.dev
Subject: [PATCH] wiphy: include libgen.h to fix implicit def. with musl libc
Date: Mon, 12 Feb 2024 10:47:47 -0800	[thread overview]
Message-ID: <20240212184747.30422-1-clayton@craftyguy.net> (raw)

This fixes a runtime segfault with musl libc and GCC13. musl dropped a
basename prototype[1] in string.h, causing GCC to define it implicitly
with the wrong function signature. The correct basename definition based
on how wiphy uses it is in libgen.h.

For context, see:
https://gitlab.alpinelinux.org/alpine/aports/-/issues/15622

1. https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
---
 src/wiphy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/wiphy.c b/src/wiphy.c
index 3258b761..9d9c6c22 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -33,6 +33,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <limits.h>
+#include <libgen.h>
 
 #include <ell/ell.h>
 
-- 
2.43.1


             reply	other threads:[~2024-02-12 18:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-12 18:47 Clayton Craft [this message]
2024-02-13 23:09 ` [PATCH] wiphy: include libgen.h to fix implicit def. with musl libc Denis Kenzior
2024-02-14  0:13   ` Clayton Craft
2024-02-14  7:03   ` Marcel Holtmann
2024-02-14 16:26     ` Denis Kenzior
2024-02-14 16:30       ` Marcel Holtmann
2024-02-14 16:35         ` Denis Kenzior
2024-02-14 16:39           ` Marcel Holtmann
2024-02-14 16:46             ` Denis Kenzior
2024-02-14 16:52               ` Marcel Holtmann
2024-03-14 22:30                 ` Clayton Craft
2024-03-15 13:49                   ` Denis Kenzior
2024-03-15 22:09                     ` Clayton Craft

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240212184747.30422-1-clayton@craftyguy.net \
    --to=clayton@craftyguy.net \
    --cc=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).