open() can fail for various reasons, so check for valid 'fd' return
before calling fdopen. Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
8270fc29f3
commit
cc0bbacb89
|
@ -351,6 +351,9 @@ eet_flush2(Eet_File *ef)
|
|||
/* opening for write - delete old copy of file right away */
|
||||
unlink(ef->path);
|
||||
fd = open(ef->path, O_CREAT | O_TRUNC | O_RDWR | O_BINARY, S_IRUSR | S_IWUSR);
|
||||
if (fd < 0)
|
||||
return EET_ERROR_NOT_WRITABLE;
|
||||
|
||||
fp = fdopen(fd, "wb");
|
||||
if (!fp)
|
||||
return EET_ERROR_NOT_WRITABLE;
|
||||
|
|
Loading…
Reference in New Issue