seoz pushed a commit to branch master.
commit 092e871dbcc83f4f5fd5c026125381c86b76d0ff
Author: Daniel Juyung Seo <[email protected]>
Date: Sun Aug 11 15:46:23 2013 +0900
quicklaunch.c: check return value of mkdir.
This fixes coverity CID 1040044 Unchecked return value from library
(CHECKED_RETURN).
---
src/bin/quicklaunch.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/bin/quicklaunch.c b/src/bin/quicklaunch.c
index 4caad3b..346cc03 100644
--- a/src/bin/quicklaunch.c
+++ b/src/bin/quicklaunch.c
@@ -166,6 +166,7 @@ main(int argc, char **argv)
char buf[PATH_MAX];
struct sigaction action;
const char *disp;
+ int ret = 0;
if (!eina_init())
{
@@ -182,7 +183,15 @@ main(int argc, char **argv)
if (!(disp = getenv("DISPLAY"))) disp = "unknown";
snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i", getuid());
- if (stat(buf, &st) < 0) mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR);
+ if (stat(buf, &st) < 0)
+ {
+ ret = mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR);
+ if (ret < 0)
+ {
+ CRITICAL("cannot create directory '%s'", buf);
+ exit(-1);
+ }
+ }
snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), disp);
unlink(buf);
sock = socket(AF_UNIX, SOCK_STREAM, 0);
--
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk