Skip to content

Commit

Permalink
virtiofsd: fix error handling in main()
Browse files Browse the repository at this point in the history
Neither fuse_parse_cmdline() nor fuse_opt_parse() goes to the right place
to do cleanup.

Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  • Loading branch information
liubogithub authored and dagrh committed Jan 23, 2020
1 parent 8a792b0 commit c6de804
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/virtiofsd/passthrough_ll.c
Expand Up @@ -2443,13 +2443,14 @@ int main(int argc, char *argv[])
lo_map_init(&lo.fd_map);

if (fuse_parse_cmdline(&args, &opts) != 0) {
return 1;
goto err_out1;
}
fuse_set_log_func(log_func);
use_syslog = opts.syslog;
if (use_syslog) {
openlog("virtiofsd", LOG_PID, LOG_DAEMON);
}

if (opts.show_help) {
printf("usage: %s [options]\n\n", argv[0]);
fuse_cmdline_help();
Expand All @@ -2468,7 +2469,7 @@ int main(int argc, char *argv[])
}

if (fuse_opt_parse(&args, &lo, lo_opts, NULL) == -1) {
return 1;
goto err_out1;
}

/*
Expand Down

0 comments on commit c6de804

Please sign in to comment.