Commit Graph

10 Commits

Author SHA1 Message Date
Johannes Sixt
36e0147fe5 Move path handling functions from spawn-pipe.c to compat/mingw.c.
Since these functions are MinGW-specific, they better belong into this
compatibility file. They will be needed there in a follow-up change that
reimplements execvp().
2007-11-02 21:34:56 +01:00
Nguyễn Thái Ngọc Duy
1e65313ceb spawnvppe_pipe: Don't overwrite argv[0]
Because caller expects it so

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
2007-10-28 20:50:02 +01:00
Johannes Sixt
d17b18abec Make mingw branch compile on Linux again 2007-05-20 21:25:49 +02:00
Johannes Sixt
273855b70f spawnvppe_pipe(): Don't die on error, some callers want to handle it. 2007-01-25 14:56:02 +01:00
Johannes Sixt
10c1047e09 Fix path_lookup() when the program to invoke contains a slash.
In this case, no path lookup actually takes place, and the returned
program name is equal to the passed in program name. But this code
path contained a thinko that crashed.
2007-01-24 18:48:59 +01:00
Johannes Sixt
5f38ff014e Split PATH into parts in advance, and pass the result to the new spawnvppe_pipe. 2007-01-19 16:34:59 +01:00
Johannes Sixt
23960ed3c3 Enable the spawn workhorse function to spawn shell scripts.
For this purpose the path lookup is done manually, and the found file
is inspected for the interpreter. If one is found, the script is spawned
under the interpreter; otherwise, the program is spawned normally.
2007-01-19 16:32:23 +01:00
Johannes Sixt
09653a29cf Move script detection into a helper function that returns the interpreter.
This will be needed later in the spawn helper functions, too,
where we want to start a shell or perl script from an exe.
2007-01-19 16:32:23 +01:00
Johannes Sixt
2bd27c7c97 Report failure when a process cannot be spawned (MinGW only). 2007-01-19 16:32:23 +01:00
Johannes Sixt
0400c502c3 Factor fork()/exec() work into a spawn() like function.
Windows does not have fork(), but something called spawn() that is roughly
equivalent to a fork()/exec() pair, factor out the Unix style code into
a function that does it more similarly to spawn(). Now the Windows style
spawn() can more easily be employed to achieve the same that the Unix style
code does.
2007-01-19 16:32:23 +01:00