projects
/
platform
/
upstream
/
efl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8270fc2
)
open() can fail for various reasons, so check for valid 'fd' return
author
Chris Michael
<cp.michael@samsung.com>
Mon, 5 Aug 2013 10:34:34 +0000
(11:34 +0100)
committer
Chris Michael
<cp.michael@samsung.com>
Mon, 5 Aug 2013 10:34:34 +0000
(11:34 +0100)
before calling fdopen.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/eet/eet_lib.c
patch
|
blob
|
history
diff --git
a/src/lib/eet/eet_lib.c
b/src/lib/eet/eet_lib.c
index a8d507eb54dc1df33840b27ed3c99fef3ee809ff..f85209aa9816209723c8562d4e01400a80913f7c 100644
(file)
--- a/
src/lib/eet/eet_lib.c
+++ b/
src/lib/eet/eet_lib.c
@@
-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;