execute, spawn-pipe: Make multithread-safe on native Windows.
commitc5388bad32e897c410336d6a3d8258cea2e9a6ad
authorBruno Haible <bruno@clisp.org>
Mon, 30 Nov 2020 16:58:57 +0000 (30 17:58 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 30 Nov 2020 16:58:57 +0000 (30 17:58 +0100)
tree2071f5a38cc34eacc334bc2d4ad513bc14acbb9e
parentc48f7d3e9dae0d7649ebf589d5202e997a89ac42
execute, spawn-pipe: Make multithread-safe on native Windows.

* lib/windows-spawn.h: Include <stdint.h>, <windows.h>.
(dup_safer_noinherit, undup_safer_noinherit): Remove declarations.
(spawnpvech): New declaration.
* lib/windows-spawn.c: Include <stdio.h>, <process.h>, findprog.h.
Don't include <unistd.h>, cloexec.h, error.h, gettext.h.
(_): Remove macro.
(dup_noinherit, fd_safer_noinherit, dup_safer_noinherit,
undup_safer_noinherit): Remove functions.
(spawnpvech): New function.
* modules/windows-spawn (Depends-on): Add findprog-in, stdint. Remove
cloexec, dup2, error, gettext-h.
* lib/execute.c: Include msvc-nothrow.h.
(execute) [WIN32]: Use _get_osfhandle, spawnpvech instead of _spawnvpe.
* lib/spawn-pipe.c: Include msvc-nothrow.h.
(create_pipe) [WIN32]: Use _get_osfhandle, DuplicateHandle, spawnpvech
instead of _spawnvpe.
* modules/execute (Depends-on): Add msvc-nothrow.
* modules/spawn-pipe (Depends-on): Likewise.
ChangeLog
lib/execute.c
lib/spawn-pipe.c
lib/windows-spawn.c
lib/windows-spawn.h
modules/execute
modules/spawn-pipe
modules/windows-spawn