* glibc offers two variants of basename(). one modifies the content of
`path`, the other does not. to be standard compliant, and to fix
the FTBFS with musl-libc, we need to use the POSIX variant.
* #include <libgen.h> for basename(3), the POSIX compliant one.
see
http://pubs.opengroup.org/onlinepubs/
009695399/functions/basename.html
Signed-off-by: Kefu Chai <kchai@redhat.com>
#include "include/int_types.h"
+#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
ifs >> cmdline;
for (unsigned i = 0; i < cmdline.size(); i++) {
- const char *arg = &cmdline[i];
+ char *arg = &cmdline[i];
if (i == 0) {
if (strcmp(basename(arg) , "rbd-nbd") != 0) {
return -EINVAL;