Commit Graph

6 Commits

Author SHA1 Message Date
Daniel Stone 17331a0c7d frontend: Add FDSTR_INIT macro
This initialises fdstr to 'safe' values so we can reliably deinit them.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-04-19 08:28:21 +00:00
Daniel Stone 2cdb473690 custom-env: Add helper to parse combined env/arg strings
Users like desktop-shell want to parse a provided string containing a
combination of environment and arg, e.g.: ENV=stuff /path/to/thing --good

Add support to custom-env for parsing this, with tests, so we can delete
the custom implementation inside desktop-shell.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-07-19 14:12:37 +00:00
Daniel Stone e568a025e1 custom-env: Add support for argument array
execve() takes the same form for arguments as environment: an array of
constant pointers to mutable strings, terminated by a NULL.

To make it easier for users who want to build up their own argument
strings to pass to execve, add support for argument arrays to custom_env.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-07-19 14:12:37 +00:00
Daniel Stone fafe5f0fc2 custom-env: Prepare for handling args as well as environment
Rename the bits handling environment variables (currently, all of it),
so we have room to handle args as well.

No functional changes.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-07-19 14:12:37 +00:00
Daniel Stone 3af823b69b process-util: Assert we don't finalize twice
Make sure that we only try to finalize once.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-07-19 14:12:37 +00:00
Daniel Stone b685e075cd process-util: Move Xwayland fork helpers to shared
We'll want to reuse these inside desktop-shell as well as the Weston
frontend.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-07-19 14:12:37 +00:00