diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2017-07-13 13:23:32 +0200 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2017-07-13 13:27:43 +0200 |
commit | 100944bd7216669701715ddd61059f9d6750a4cf (patch) | |
tree | 09aa9b130b9dea938a78d38449fe764d5182c78d /lib | |
parent | 5a5edc3353f468600933112422f080004189a665 (diff) |
Only declare fuse_new_30() when FUSE_USE_VERSION == 30
This function shouldn't be called when using a newer fuse
version, so we should not define it in that case.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fuse.c | 50 |
1 files changed, 26 insertions, 24 deletions
@@ -4626,30 +4626,6 @@ void fuse_stop_cleanup_thread(struct fuse *f) } -/* Emulates 3.0-style fuse_new(), which processes --help */ -FUSE_SYMVER(".symver fuse_new_30,fuse_new@FUSE_3.0"); -struct fuse *fuse_new_30(struct fuse_args *args, - const struct fuse_operations *op, - size_t op_size, void *user_data) -{ - struct fuse_config conf; - const struct fuse_opt opts[] = { - FUSE_LIB_OPT("-h", show_help, 1), - FUSE_LIB_OPT("--help", show_help, 1), - FUSE_OPT_END - }; - - if (fuse_opt_parse(args, &conf, opts, - fuse_lib_opt_proc) == -1) - return NULL; - - if (conf.show_help) { - fuse_lib_help(args); - return NULL; - } else - return fuse_new_31(args, op, op_size, user_data); -} - /* Explicit prototype to prevent compiler warnings (fuse.h only defines fuse_new()) */ struct fuse *fuse_new_31(struct fuse_args *args, const struct fuse_operations *op, @@ -4803,6 +4779,32 @@ out: return NULL; } +/* Emulates 3.0-style fuse_new(), which processes --help */ +struct fuse *fuse_new_30(struct fuse_args *args, const struct fuse_operations *op, + size_t op_size, void *private_data); +FUSE_SYMVER(".symver fuse_new_30,fuse_new@FUSE_3.0"); +struct fuse *fuse_new_30(struct fuse_args *args, + const struct fuse_operations *op, + size_t op_size, void *user_data) +{ + struct fuse_config conf; + const struct fuse_opt opts[] = { + FUSE_LIB_OPT("-h", show_help, 1), + FUSE_LIB_OPT("--help", show_help, 1), + FUSE_OPT_END + }; + + if (fuse_opt_parse(args, &conf, opts, + fuse_lib_opt_proc) == -1) + return NULL; + + if (conf.show_help) { + fuse_lib_help(args); + return NULL; + } else + return fuse_new_31(args, op, op_size, user_data); +} + void fuse_destroy(struct fuse *f) { size_t i; |