Enlightenment CVS committal
Author : onefang
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore
Modified Files:
Ecore.h ecore_exe.c ecore_private.h
Log Message:
New flag to allow forcing the use of /bin/sh to execute the command.
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/Ecore.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -3 -r1.47 -r1.48
--- Ecore.h 24 Jan 2006 13:58:18 -0000 1.47
+++ Ecore.h 5 Apr 2006 18:05:16 -0000 1.48
@@ -92,7 +92,8 @@
ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, /**< Reads are buffered until a
newline and delivered 1 event per line */
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, /**< Errors are buffered until a
newline and delivered 1 event per line */
ECORE_EXE_PIPE_AUTO = 32, /**< stdout and stderr are buffered automatically
*/
- ECORE_EXE_RESPAWN = 64 /**< FIXME: Exe is restarted if it dies */
+ ECORE_EXE_RESPAWN = 64, /**< FIXME: Exe is restarted if it dies */
+ ECORE_EXE_USE_SH = 128 /**< Use /bin/sh to run the command. */
};
typedef enum _Ecore_Exe_Flags Ecore_Exe_Flags;
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/ecore_exe.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- ecore_exe.c 1 Mar 2006 05:05:58 -0000 1.57
+++ ecore_exe.c 5 Apr 2006 18:05:16 -0000 1.58
@@ -11,7 +11,7 @@
char *cmd;
};
-static inline void _ecore_exe_exec_it(const char *exe_cmd);
+static inline void _ecore_exe_exec_it(const char *exe_cmd, Ecore_Exe_Flags
flags);
static int _ecore_exe_data_generic_handler(void *data,
Ecore_Fd_Handler *
@@ -228,7 +228,7 @@
exes = _ecore_list2_append(exes, exe);
return exe;
}
- _ecore_exe_exec_it(exe_cmd);
+ _ecore_exe_exec_it(exe_cmd, 0);
exit(127);
return NULL;
#else
@@ -355,7 +355,7 @@
E_IF_NO_ERRNO(result, fcntl(statusPipe[1], F_SETFD,
FD_CLOEXEC), ok) /* close on exec shows sucess */
{
/* Run the actual command. */
- _ecore_exe_exec_it(exe_cmd); /* Should not return
from this. */
+ _ecore_exe_exec_it(exe_cmd, flags); /* Should not
return from this. */
}
}
@@ -1147,7 +1147,7 @@
}
static inline void
-_ecore_exe_exec_it(const char *exe_cmd)
+_ecore_exe_exec_it(const char *exe_cmd, Ecore_Exe_Flags flags)
{
char use_sh = 1;
char *buf = NULL;
@@ -1213,7 +1213,12 @@
}
setsid();
- if (use_sh)
+ if ((flags & ECORE_EXE_USE_SH))
+ {
+ errno = 0;
+ execl("/bin/sh", "/bin/sh", "-c", exe_cmd, (char *)NULL);
+ }
+ else if (use_sh)
{ /* We have to use a shell to run this. */
if (shell == NULL)
{ /* Find users preferred shell. */
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/ecore_private.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- ecore_private.h 14 Feb 2006 12:54:26 -0000 1.40
+++ ecore_private.h 5 Apr 2006 18:05:16 -0000 1.41
@@ -157,7 +157,8 @@
ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8,
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16,
ECORE_EXE_PIPE_AUTO = 32,
- ECORE_EXE_RESPAWN = 64
+ ECORE_EXE_RESPAWN = 64,
+ ECORE_EXE_USE_SH = 128
/* FIXME: Getting respawn to work
*
* There is no way that we can do anything about the internal state info of
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs