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

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



From: "Daniel P. Berrange" <berrange redhat com>

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 redhat com>
---
 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


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