efreet: Check return value of chmod

CID: #1039716
This commit is contained in:
Sebastian Dransfeld 2013-08-07 10:02:05 +02:00
parent 73ad466cbc
commit 6a7f417cec
1 changed files with 9 additions and 3 deletions

View File

@ -30,13 +30,19 @@ main(int argc, char *argv[])
char *path;
FILE *log;
if (!eina_init()) return 1;
strcpy(buf, "/tmp/efreetd_XXXXXX");
path = mktemp(buf);
if (!path) return 1;
chmod(path, 0700);
if (chmod(path, 0700) < 0)
{
perror("chmod");
return 1;
}
log = fopen(path, "wb");
if (!log) return 1;
if (!eina_init()) return 1;
eina_log_print_cb_set(eina_log_print_cb_file, log);
efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR);