Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > a62fc3f0285cc2de0a054bc489e77163 > files > 1

migration-assistant-0.5.1-3mdv2008.0.src.rpm

--- migration-assistant/utils.c.close	2007-08-09 17:13:49.000000000 +0200
+++ migration-assistant/utils.c	2007-08-10 14:21:25.000000000 +0200
@@ -91,8 +91,11 @@ void copyfile(const char* from, const ch
         puts("fstat error");
 	    exit(EXIT_FAILURE);
     }
-    if(statbuf.st_size == 0)
+    if(statbuf.st_size == 0) {
+        close(fdin);
+        close(fdout);
         return;
+    }
 
     /* set size of output file */
     if (lseek(fdout, statbuf.st_size - 1, SEEK_SET) == -1) {
@@ -117,6 +120,9 @@ void copyfile(const char* from, const ch
     }
 
     memcpy(dst, src, statbuf.st_size); /* does the file copy */
+
+    close(fdin);
+    close(fdout);
 }
 
 void rcopy(const char* from, const char* to) {
@@ -185,6 +191,7 @@ void create_file(const char* file) {
     FILE* fp;
     char* tmp;
     char* filename;
+    int fd;
 
     if((fp = fopen(file, "r")) != NULL) {
 	fclose(fp);
@@ -196,7 +203,8 @@ void create_file(const char* file) {
     makedirs(filename);
     free(tmp);
 
-    creat(file, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+    fd = creat(file, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+    close(fd);
 }
 void add_wallpaper (const char* path) {
     xmlDoc* doc = NULL;