diff options
| author | Tony Ambardar | 2024-03-06 00:27:42 +0000 |
|---|---|---|
| committer | Tony Ambardar | 2024-03-30 21:30:41 +0000 |
| commit | 946552a7b598a0b88db6101e864679554ec4f221 (patch) | |
| tree | 960576b81f68d4a4852d53e7a3699da05f30aeb5 | |
| parent | 254810d16cf18cb19ca5766dc6fe967b7015722f (diff) | |
trace: use standard POSIX header for basename()
The musl libc only implements POSIX basename() but provided a GNU header
kludge in <string.h>, which was removed in musl 1.2.5 [1]. Use the standard
<libgen.h> header to avoid compilation errors like:
trace/trace.c: In function 'main':
trace/trace.c:435:64: error: implicit declaration of function 'basename';
did you mean 'rename'? [-Werror=implicit-function-declaration]
435 | if (asprintf(&json, "/tmp/%s.%u.json", basename(*argv), child) < 0)
| ^~~~~~~~
| rename
cc1: all warnings being treated as errors
Link 1: https://git.musl-libc.org/cgit/musl/log/?qt=grep&q=basename
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
| -rw-r--r-- | trace/trace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/trace/trace.c b/trace/trace.c index 6fd321f..e257d89 100644 --- a/trace/trace.c +++ b/trace/trace.c @@ -23,7 +23,7 @@ #include <stdlib.h> #include <stdio.h> #include <errno.h> -#include <string.h> +#include <libgen.h> #include <syslog.h> #include <limits.h> |