]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-bluestore-tool: the link target should not ending with new line 18585/head
authorYao Zongyou <yaozongyou@vip.qq.com>
Sat, 28 Oct 2017 10:23:30 +0000 (18:23 +0800)
committerYao Zongyou <yaozongyou@vip.qq.com>
Sat, 28 Oct 2017 10:23:30 +0000 (18:23 +0800)
Signed-off-by: Yao Zongyou <yaozongyou@vip.qq.com>
src/os/bluestore/bluestore_tool.cc

index d41b5052a505fc30750e643135df6ce49b48fb30..6811b6a338d4c1d8e85b234bb306374d57eb4438 100644 (file)
@@ -332,7 +332,6 @@ int main(int argc, char **argv)
        v += label.meta["whoami"];
        v += "]\nkey = " + i->second;
       }
-      v += "\n";
       if (k.find("path_") == 0) {
        p = path + "/" + k.substr(5);
        int r = ::symlink(v.c_str(), p.c_str());
@@ -361,6 +360,7 @@ int main(int argc, char **argv)
          exit(EXIT_FAILURE);
        }
       } else {
+       v += "\n";
        int fd = ::open(p.c_str(), O_CREAT|O_TRUNC|O_WRONLY, 0600);
        if (fd < 0) {
          cerr << "error writing " << p << ": " << cpp_strerror(errno)