Skip to content
Commit 8b08b48d authored by Tony Ambardar's avatar Tony Ambardar
Browse files

rpcd-mod-luci: 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:

luci.c: In function 'rpc_luci_parse_network_device_sys':
luci.c:676:53: error: implicit declaration of function 'basename' [-Werror=implicit-function-declaration]
  676 |                 blobmsg_add_string(&blob, "master", basename(link));
      |                                                     ^~~~~~~~
luci.c:676:53: error: passing argument 3 of 'blobmsg_add_string' makes pointer from integer without a cast [-Werror=int-conversion]
  676 |                 blobmsg_add_string(&blob, "master", basename(link));
      |                                                     ^~~~~~~~~~~~~~
      |                                                     |
      |                                                     int
...
cc1: all warnings being treated as errors

Link 1: https://git.musl-libc.org/cgit/musl/log/?qt=grep&q=basename

Signed-off-by: default avatarTony Ambardar <itugrok@yahoo.com>
parent f630f224
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment