summaryrefslogtreecommitdiff
path: root/modules/windows-spawn
Commit message (Collapse)AuthorAgeFilesLines
* windows-spawn: Relicense under LGPLv2+.Bruno Haible2020-12-111-1/+1
| | | | * modules/windows-spawn (License): Change to LGPLv2+.
* execute, spawn-pipe: Fix memory leak on native Windows.Bruno Haible2020-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | * lib/windows-spawn.h (prepare_spawn): Add a second parameter. * lib/windows-spawn.c: Don't include xalloc.h. (quoted_arg_length, quoted_arg_string): New functions, extracted from prepare_spawn. (prepare_spawn): Use malloc instead of XNMALLOC. Allocate memory for all elements of *new_argv together. * modules/windows-spawn (Depends-on): Remove xalloc. Add malloc-posix. * lib/os2-spawn.h (prepare_spawn): Add a second parameter. * lib/os2-spawn.c: Don't include xalloc.h. (prepare_spawn): Use malloc instead of XNMALLOC. Allocate memory for all elements of *new_argv together. * lib/execute.c: Include xalloc.h. (execute): Check return value of prepare_spawn. Free the memory allocated by prepare_spawn. * modules/execute (Depends-on): Add xalloc-die. * lib/spawn-pipe.c: Include xalloc.h. (create_pipe): Check return value of prepare_spawn. Free the memory allocated by prepare_spawn. * modules/spawn-pipe (Depends-on): Add xalloc-die.
* execute, spawn-pipe: Make multithread-safe on native Windows.Bruno Haible2020-11-301-4/+2
| | | | | | | | | | | | | | | | | | | | | * 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.
* windows-spawn: New module.Bruno Haible2020-11-281-0/+37
* lib/windows-spawn.h: Renamed from lib/w32spawn.h. Remove implementations. * lib/windows-spawn.c: Renamed from lib/w32spawn.h. * modules/windows-spawn: New file. * lib/execute.c: Include "windows-spawn.h" instead of "w32spawn.h". * lib/spawn-pipe.c: Likewise. * modules/execute (Files): Remove lib/w32spawn.h. (Depends-on): Add windows-spawn. Remove cloexec, msvc-nothrow, strpbrk, xalloc. (Makefile.am): Remove w32spawn.h from lib_SOURCES. * modules/spawn-pipe (Files): Remove lib/w32spawn.h. (Depends-on): Add windows-spawn. Remove cloexec, msvc-nothrow, strpbrk, xalloc. (Makefile.am): Remove w32spawn.h from lib_SOURCES.