-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mimic GNU basename() API for non-glibc library e.g. musl #15561
Conversation
Even more, we have compile errors:
|
zebra/zebra_netns_notify.c
Outdated
@@ -41,6 +41,10 @@ | |||
#define ZEBRA_NS_POLLING_INTERVAL_MSEC 1000 | |||
#define ZEBRA_NS_POLLING_MAX_RETRIES 200 | |||
|
|||
#if !defined(__GLIBC__) | |||
#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just loudly thinking, if we need to add an additional check here:
#ifndef basename
#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would that get us ? it is in a .c source file unless its included multiple times, it wont be useful.
CI:rerun Rerun after fixing git access on CI infra |
@kraj can you please rebase on top of master? will try to get his in. |
done |
minor nit by the linter
|
musl only provides POSIX version of basename and it has also removed providing it via string.h header [1] which now results in compile errors with newer compilers e.g. clang-18 [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 Signed-off-by: Khem Raj <[email protected]>
Thank you @kraj. Ping me if you need any help to get FRR on OE side. |
Oh, BTW, would love to see 10.1 on scarthgap. I can backport this to 10.1 if that helps. |
We are on 10.0.1 atm, isnt 10.1 a major release compared to 10.0 ? if not then its easier to get it in if major release its against the policy sadly but we can make a case if there are critical fixes and features in 10.1 |
10.1 is a minor release. 10.0 was a major release mainly due to the push for support NB interface. 10.1 improves on that. |
thanks please push this change to 10.1 as well and we can try to get scarthgap updated to use it |
@Mergifyio backport stable/10.1 |
✅ Backports have been created
|
Mimic GNU basename() API for non-glibc library e.g. musl (backport #15561)
@kraj backport merged to |
musl only provides POSIX version of basename and it has also removed providing it via string.h header [1] which now results in compile errors with newer compilers e.g. clang-18
[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7