blob: 1b7c9079c1d9a309d5ccd4ab2316396c6a4949bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
fix for musl
diff -Nurp a/src/tools/rbd_nbd/rbd-nbd.cc b/src/tools/rbd_nbd/rbd-nbd.cc
--- a/src/tools/rbd_nbd/rbd-nbd.cc 2020-11-21 08:06:35.834423310 +0000
+++ b/src/tools/rbd_nbd/rbd-nbd.cc 2020-11-21 08:21:12.067978842 +0000
@@ -576,7 +576,8 @@ private:
for (unsigned i = 0; i < cmdline.size(); i++) {
char *arg = &cmdline[i];
if (i == 0) {
- if (strcmp(basename(arg) , "rbd-nbd") != 0) {
+ const char *fname = strrchr(arg, '/');
+ if (strcmp(fname ? fname+1 : arg, "rbd-nbd") != 0) {
return -EINVAL;
}
} else {
|