summaryrefslogtreecommitdiff
path: root/lib/os2-spawn.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* sh-quote, execute, spawn-pipe, etc.: Make better use of 'const'.Bruno Haible2020-12-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/sh-quote.h (shell_quote_argv): Does not need write access to the elements of argv. * lib/sh-quote.c (shell_quote_argv): Likewise. * lib/windows-spawn.h (prepare_spawn): Add 'const' the argument type and the return type. * lib/windows-spawn.c (prepare_spawn): Likewise. * lib/os2-spawn.h (prepare_spawn): Likewise. * lib/os2-spawn.c (prepare_spawn): Likewise. * lib/execute.h (execute): Does not need write access to the elements of prog_argv. * lib/execute.c (execute): Likewise. * lib/spawn-pipe.h (create_pipe_out, create_pipe_in, create_pipe_bidi): Likewise. * lib/spawn-pipe.c (create_pipe, create_pipe_bidi, create_pipe_in, create_pipe_out): Likewise. * lib/pipe-filter.h (pipe_filter_ii_execute, pipe_filter_gi_create): Likewise. * lib/pipe-filter-ii.c (pipe_filter_ii_execute): Likewise. * lib/pipe-filter-gi.c (pipe_filter_gi_create): Likewise. * lib/javaexec.h (execute_fn): Does not need write access to the elements of prog_argv. * lib/javaexec.c (execute_java_class): Update variable types and remove casts to 'char *'. * lib/csharpexec.h (execute_fn): Does not need write access to the elements of prog_argv. * lib/csharpexec.c (execute_csharp_using_mono, execute_csharp_using_sscli): Update variable types and remove casts to 'char *'. * lib/javacomp.c (compile_using_envjavac, compile_using_gcj, compile_using_javac, compile_using_jikes, is_envjavac_gcj, is_envjavac_gcj43, is_gcj_present, is_gcj_43, is_javac_present, is_jikes_present): Update variable types and remove casts to 'char *'. * lib/javaversion.c (execute_and_read_line): Does not need write access to the elements of prog_argv. * lib/csharpcomp.c (compile_csharp_using_mono, compile_csharp_using_sscli): Update variable types and remove casts to 'char *'. * tests/test-sh-quote.c (main): Update variable types and remove casts to 'char *'. * tests/test-execute-main.c (main): Update variable types and remove casts to 'char *'. * tests/test-spawn-pipe-main.c (test_pipe): Update variable types and remove casts to 'char *'. * NEWS: Mention the changes.
* execute, spawn-pipe: Fix memory leak on native Windows.Bruno Haible2020-12-111-9/+36
| | | | | | | | | | | | | | | | | | | | | | * 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.
* spawn-pipe: Fix build on OS/2 kLIBC (regression 2020-11-28).Bruno Haible2020-11-291-0/+128
* lib/os2-spawn.h: New file, based on lib/windows-spawn.h. * lib/os2-spawn.c: New file, based on lib/windows-spawn.c. * lib/spawn-pipe.c: On OS/2 kLIBC, include "os2-spawn.h". * lib/windows-spawn.c: Remove modifications for kLIBC. * modules/spawn-pipe (Files): Add the new files. (configure.ac): Arrange to compile os2-spawn.c on OS/2.