From: Jos Collin Date: Thu, 8 Mar 2018 13:12:25 +0000 (+0530) Subject: ceph-fuse: trim ceph-fuse -V output X-Git-Tag: v12.2.6~87^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eb9cf1fe096f5f005734dd2e39c164e12770574d;p=ceph.git ceph-fuse: trim ceph-fuse -V output Trim 'ceph-fuse -V' output to print the FUSE library version and exit. Fixes: http://tracker.ceph.com/issues/23248 Signed-off-by: Jos Collin (cherry picked from commit bfa5d4e3be54a188e9931d9d26a3e053fa95c531) --- diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc index 851425af0970..cab48fc5d73f 100644 --- a/src/ceph_fuse.cc +++ b/src/ceph_fuse.cc @@ -93,6 +93,19 @@ int main(int argc, const char **argv, const char *envp[]) { filer_flags |= CEPH_OSD_FLAG_LOCALIZE_READS; } else if (ceph_argparse_flag(args, i, "-h", "--help", (char*)NULL)) { usage(); + } else if (ceph_argparse_flag(args, i, "-V", (char*)nullptr)) { + const char* tmpargv[] = { + "ceph-fuse", + "-V" + }; + + struct fuse_args fargs = FUSE_ARGS_INIT(2, (char**)tmpargv); + if (fuse_parse_cmdline(&fargs, nullptr, nullptr, nullptr) == -1) { + derr << "fuse_parse_cmdline failed." << dendl; + } + assert(fargs.allocated); + fuse_opt_free_args(&fargs); + exit(0); } else { ++i; }