Check if file was really open before continue.

If we tried to create the new rw file, we must check if it was created
fine before continue, lots of errors are possible there, but mine was
creating the file inside an nonexistent directory.


SVN revision: 34928
This commit is contained in:
Gustavo Sverzut Barbieri 2008-06-27 22:05:49 +00:00
parent 387d29e262
commit ed239be74a
1 changed files with 2 additions and 0 deletions

View File

@ -1267,6 +1267,8 @@ eet_open(const char *file, Eet_File_Mode mode)
ef->readfp = ef->fp;
unlink(ef->path);
ef->fp = fopen(ef->path, "wb");
if (eet_test_close(!ef->fp, ef))
return NULL;
fcntl(fileno(ef->fp), F_SETFD, FD_CLOEXEC);
}