aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/fuse_lowlevel.c12
-rw-r--r--lib/fuse_opt.c14
2 files changed, 14 insertions, 12 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index 370e320..b35b16a 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -925,6 +925,14 @@ static struct fuse_opt fuse_ll_opts[] = {
FUSE_OPT_END
};
+static int fuse_ll_opt_proc(void *data, const char *arg, int key)
+{
+ (void) data;
+ (void) key;
+ fprintf(stderr, "fuse: unknown option `%s'\n", arg);
+ return -1;
+}
+
int fuse_lowlevel_is_lib_option(const char *opt)
{
return fuse_opt_match(fuse_ll_opts, opt);
@@ -964,8 +972,8 @@ struct fuse_session *fuse_lowlevel_new(const char *opts,
if (opts) {
const char *argv[] = { "", "-o", opts, NULL };
- if (fuse_opt_parse(3, (char **) argv, f, fuse_ll_opts, NULL,
- NULL, NULL) == -1)
+ if (fuse_opt_parse(3, (char **) argv, f, fuse_ll_opts,
+ fuse_ll_opt_proc, NULL, NULL) == -1)
goto out_free;
}
diff --git a/lib/fuse_opt.c b/lib/fuse_opt.c
index f49e85d..e3234f2 100644
--- a/lib/fuse_opt.c
+++ b/lib/fuse_opt.c
@@ -114,17 +114,11 @@ static int insert_arg(struct fuse_opt_context *ctx, int pos, const char *arg)
static int call_proc(struct fuse_opt_context *ctx, const char *arg, int key,
int iso)
{
- int res;
-
- if (!ctx->proc) {
- fprintf(stderr, "fuse: unknown option `%s'\n", arg);
- return -1;
+ if (ctx->proc) {
+ int res = ctx->proc(ctx->data, arg, key);
+ if (res == -1 || !res)
+ return res;
}
-
- res = ctx->proc(ctx->data, arg, key);
- if (res == -1 || !res)
- return res;
-
if (iso)
return add_opt(ctx, arg);
else