execute: Allow caller to specify directory for the subprocess.
commit702cba00f4ff7b22f0684a23db0fb66aea2c4086
authorBruno Haible <bruno@clisp.org>
Wed, 2 Dec 2020 16:44:04 +0000 (2 17:44 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 2 Dec 2020 16:44:58 +0000 (2 17:44 +0100)
tree70d1a7a885bc8cbf61a0512f903588c481c5a2ca
parenta10b317852a1bfbc7f26818ced908aa654709f0a
execute: Allow caller to specify directory for the subprocess.

* lib/execute.h (execute): Add directory argument.
* lib/execute.c: Include canonicalize.h, filename.h, findprog.h.
(execute): Add directory argument. If specified, resolve the program
file name and make it absolute, first. Pass the directory to spawnpvech
and posix_spawn_file_actions_addchdir.
* modules/execute (Depends-on): Add canonicalize, filename, findprog-in,
posix_spawn, posix_spawn_file_actions_addchdir.
* tests/test-execute-main.c: Add test for passing a directory.
* tests/test-execute-child.c: Likewise.
* tests/test-execute.sh: Update.
* modules/execute-tests (Depends-on): Add mkdir.
* NEWS: Mention the change.
* lib/csharpcomp.c (compile_csharp_using_sscli): Update.
* lib/csharpexec.c (execute_csharp_using_mono,
execute_csharp_using_sscli): Update.
* lib/javacomp.c (compile_using_envjavac, compile_using_gcj,
compile_using_javac, compile_using_jikes, is_javac_present,
is_jikes_present): Update.
* lib/javaexec.c (execute_java_class): Update.
13 files changed:
ChangeLog
NEWS
lib/csharpcomp.c
lib/csharpexec.c
lib/execute.c
lib/execute.h
lib/javacomp.c
lib/javaexec.c
modules/execute
modules/execute-tests
tests/test-execute-child.c
tests/test-execute-main.c
tests/test-execute.sh