--- 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;