peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0086-virtiofsd-fix-error-handling-in-main.patch

1d442b
From: Liu Bo <bo.liu@linux.alibaba.com>
1d442b
Date: Mon, 27 Jan 2020 19:01:55 +0000
1d442b
Subject: [PATCH] virtiofsd: fix error handling in main()
1d442b
MIME-Version: 1.0
1d442b
Content-Type: text/plain; charset=UTF-8
1d442b
Content-Transfer-Encoding: 8bit
1d442b
1d442b
Neither fuse_parse_cmdline() nor fuse_opt_parse() goes to the right place
1d442b
to do cleanup.
1d442b
1d442b
Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
1d442b
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
1d442b
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442b
(cherry picked from commit c6de804670f2255ce776263124c37f3370dc5ac1)
1d442b
---
1d442b
 tools/virtiofsd/passthrough_ll.c | 5 +++--
1d442b
 1 file changed, 3 insertions(+), 2 deletions(-)
1d442b
1d442b
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
1d442b
index 9ed77a17fd..af050c6d97 100644
1d442b
--- a/tools/virtiofsd/passthrough_ll.c
1d442b
+++ b/tools/virtiofsd/passthrough_ll.c
1d442b
@@ -2443,13 +2443,14 @@ int main(int argc, char *argv[])
1d442b
     lo_map_init(&lo.fd_map);
1d442b
 
1d442b
     if (fuse_parse_cmdline(&args, &opts) != 0) {
1d442b
-        return 1;
1d442b
+        goto err_out1;
1d442b
     }
1d442b
     fuse_set_log_func(log_func);
1d442b
     use_syslog = opts.syslog;
1d442b
     if (use_syslog) {
1d442b
         openlog("virtiofsd", LOG_PID, LOG_DAEMON);
1d442b
     }
1d442b
+
1d442b
     if (opts.show_help) {
1d442b
         printf("usage: %s [options]\n\n", argv[0]);
1d442b
         fuse_cmdline_help();
1d442b
@@ -2468,7 +2469,7 @@ int main(int argc, char *argv[])
1d442b
     }
1d442b
 
1d442b
     if (fuse_opt_parse(&args, &lo, lo_opts, NULL) == -1) {
1d442b
-        return 1;
1d442b
+        goto err_out1;
1d442b
     }
1d442b
 
1d442b
     /*