raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=308e9586ddb56cfe7c04663715068d5d414dbf0b

commit 308e9586ddb56cfe7c04663715068d5d414dbf0b
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Mon Mar 26 21:07:46 2018 +0900

    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.
---
 src/lib/ecore/efl_exe.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c
index 01e7497977..73fd264444 100644
--- a/src/lib/ecore/efl_exe.c
+++ b/src/lib/ecore/efl_exe.c
@@ -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
 }

-- 


Reply via email to