diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-11-05 16:22:31 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-11-05 16:22:31 +0000 |
commit | b13b07451fdadad85007d61fd749c36beb616518 (patch) | |
tree | 5ee78eb034a3bf465dfe890c3aa0b096899d925f | |
parent | faf5808b8f86976e6c2998ecf5dacd9c321e54c3 (diff) | |
parent | 20185cfd3f713a23bc9303d626c6244a570b5188 (diff) |
Merge branch 'cygwin-patches-for-1.11' into cygwin-release-1.11xserver-cygwin-1.11.2-1
-rw-r--r-- | os/utils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/os/utils.c b/os/utils.c index f8c7178de..9b5f0d4bb 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1254,6 +1254,25 @@ OsAbort (void) * as well. As it is now, xkbcomp messages don't end up in the log file. */ +#ifdef __CYGWIN__ +#include <process.h> +int +System(char *command) +{ + int status; + if (!command) + return 1; + + DebugF("System: `%s'\n", command); + + /* + Use spawnl() rather than execl() to implement System() on cygwin to + avoid fork emulation overhead and brittleness + */ + status = spawnl(_P_WAIT, "/bin/sh", "sh", "-c", command, (char *)NULL); + return status; +} +#else int System(char *command) { @@ -1295,6 +1314,7 @@ System(char *command) return p == -1 ? -1 : status; } +#endif static struct pid { struct pid *next; |