make new dir creation more clear for error conditions

This commit is contained in:
Mike Blumenkrantz 2013-05-28 14:37:53 +01:00
parent 7ae5da88da
commit 5d6b139f35
1 changed files with 12 additions and 6 deletions

View File

@ -9586,11 +9586,14 @@ _e_fm2_new_thread_helper(Ecore_Thread *eth, Eina_Bool dir)
errno = 0;
if (stat(buf, &st) && (errno == ENOENT))
{
if (dir && ecore_file_mkdir(buf))
if (dir)
{
if (ecore_file_mkdir(buf))
{
ecore_thread_feedback(eth, strdup(buf));
return;
}
}
else
{
fd = open(buf, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
@ -9611,11 +9614,14 @@ _e_fm2_new_thread_helper(Ecore_Thread *eth, Eina_Bool dir)
errno = 0;
if (stat(buf, &st) && (errno == ENOENT))
{
if (dir && ecore_file_mkdir(buf))
if (dir)
{
if (ecore_file_mkdir(buf))
{
ecore_thread_feedback(eth, strdup(buf));
return;
}
}
else
{
fd = open(buf, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);