From ed239be74a1eee91ca4b9606178ad03cedbdc1ec Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Fri, 27 Jun 2008 22:05:49 +0000 Subject: [PATCH] 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 --- legacy/eet/src/lib/eet_lib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/legacy/eet/src/lib/eet_lib.c b/legacy/eet/src/lib/eet_lib.c index 3b601e5060..2b2fdd17a2 100644 --- a/legacy/eet/src/lib/eet_lib.c +++ b/legacy/eet/src/lib/eet_lib.c @@ -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); }