[evince] libview: close tmpfile descriptor before copying to it



commit 0edfe50d1f21fffa695d046615dc3297b87050de
Author: Hib Eris <hib hiberis nl>
Date:   Thu Jun 9 13:18:22 2011 +0200

    libview: close tmpfile descriptor before copying to it
    
    It seems that on Windows, g_file_copy() does not work on files with a
    file desciptor open.
    
    This is done to fix saving of tiff files on Windows.

 libview/ev-jobs.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/libview/ev-jobs.c b/libview/ev-jobs.c
index 816a56b..d7abaab 100644
--- a/libview/ev-jobs.c
+++ b/libview/ev-jobs.c
@@ -1094,6 +1094,7 @@ ev_job_save_run (EvJob *job)
 
 		return FALSE;
 	}
+	close (fd);
 
 	ev_document_doc_mutex_lock ();
 
@@ -1103,8 +1104,6 @@ ev_job_save_run (EvJob *job)
                 ev_document_save (job->document, local_uri, &error);
         }
 
-	close (fd);
-
 	ev_document_doc_mutex_unlock ();
 
 	if (error) {



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