[PATCH vd_agent_linux 3/7] file-xfers: Allocate file_path after disk space check

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

 



Variable is not used. Keep code to create file together.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 src/vdagent/file-xfers.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/vdagent/file-xfers.c b/src/vdagent/file-xfers.c
index 67bad9e..77029e7 100644
--- a/src/vdagent/file-xfers.c
+++ b/src/vdagent/file-xfers.c
@@ -202,8 +202,6 @@ void vdagent_file_xfers_start(struct vdagent_file_xfers *xfers,
 
     task->debug = xfers->debug;
 
-    file_path = g_build_filename(xfers->save_dir, task->file_name, NULL);
-
     free_space = get_free_space_available(xfers->save_dir);
     if (task->file_size > free_space) {
         gchar *free_space_str, *file_size_str;
@@ -223,6 +221,7 @@ void vdagent_file_xfers_start(struct vdagent_file_xfers *xfers,
         goto cleanup;
     }
 
+    file_path = g_build_filename(xfers->save_dir, task->file_name, NULL);
     dir = g_path_get_dirname(file_path);
     if (g_mkdir_with_parents(dir, S_IRWXU) == -1) {
         syslog(LOG_ERR, "file-xfer: Failed to create dir %s", dir);
-- 
2.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]