[PATCH sandbox 2/9] Remove unused 'int fd' variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

The 'int fd' variable in gvir_sandbox_builder_machine_mkinitrd was
no longer used, causing a coverity warning about dead code.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 libvirt-sandbox/libvirt-sandbox-builder-machine.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libvirt-sandbox/libvirt-sandbox-builder-machine.c b/libvirt-sandbox/libvirt-sandbox-builder-machine.c
index 6b9b506..229a6cc 100644
--- a/libvirt-sandbox/libvirt-sandbox-builder-machine.c
+++ b/libvirt-sandbox/libvirt-sandbox-builder-machine.c
@@ -153,7 +153,6 @@ static gchar *gvir_sandbox_builder_machine_mkinitrd(GVirSandboxConfig *config,
     GVirSandboxConfigInitrd *initrd = gvir_sandbox_config_initrd_new();
     GVirSandboxBuilderInitrd *builder = gvir_sandbox_builder_initrd_new();
     gchar *targetfile = g_strdup_printf("%s/initrd.img", statedir);
-    int fd = -1;
     gchar *kver = gvir_sandbox_builder_machine_get_kernrelease(config);
     const gchar *kmodpath = gvir_sandbox_config_get_kmodpath(config);
     if (!kmodpath)
@@ -183,8 +182,6 @@ static gchar *gvir_sandbox_builder_machine_mkinitrd(GVirSandboxConfig *config,
         goto cleanup;
 
 cleanup:
-    if (fd != -1)
-        close(fd);
     if (*error) {
         g_free(targetfile);
         targetfile = NULL;
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]