ecore - efl exe - use better exit codes

127 is the "command not found" shell exeit code, 126 is "the command
file is found but is not executable" which i think i'd interpret not
just for execute permissions but that something is preventing it from
executing in general.
This commit is contained in:
Carsten Haitzler 2018-03-26 21:07:46 +09:00
parent 0a3e7c05e4
commit 308e9586dd
1 changed files with 6 additions and 3 deletions

View File

@ -511,9 +511,9 @@ _efl_exe_efl_task_run(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
close(devnull);
}
if (!(loop = efl_provider_find(obj, EFL_LOOP_CLASS))) exit(-120);
if (!(loop = efl_provider_find(obj, EFL_LOOP_CLASS))) exit(1);
if (!(tdl = efl_data_scope_get(loop, EFL_TASK_CLASS))) exit(-121);
if (!(tdl = efl_data_scope_get(loop, EFL_TASK_CLASS))) exit(1);
// clear systemd notify socket... only relevant for systemd world,
// otherwise shouldn't be trouble
@ -533,7 +533,10 @@ _efl_exe_efl_task_run(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
// actually execute!
_exec(cmd, pd->flags);
// we couldn't exec... uh oh. HAAAAAAAALP!
exit(-122);
if ((errno == EACCES) || (errno == EINVAL) || (errno == ELOOP) ||
(errno == ENOEXEC) || (errno == ENOMEM))
exit(126);
exit(127);
return NULL;
#endif
}