summaryrefslogtreecommitdiff
path: root/src/spawn.hh
Commit message (Collapse)AuthorAgeFilesLines
* all: Clean up licence headersChristian Persch2021-01-311-8/+8
| | | | | | | | | | | Unify the licence headers so that all same-licensed files use the exact same text. For some time now, libvte has been effectively LGPL3+ due to newer files being LGPL3+ only while some older files were still nominally LGPL2+ as per their licence headers. Exercise the "or (at your option) any later version" upgrade option to henceforth use, modify and distribute all these files under LGPL3+ only.
* spawn: Clarify ownership transferChristian Persch2020-10-221-6/+10
| | | | | Pass unqiue_ptr<SpawnOperation> to ::run_async to make it clear that it takes ownership of the operation.
* spawn: Async-signal-safety fixesChristian Persch2020-07-181-5/+6
| | | | | | | Ported from https://gitlab.gnome.org/GNOME/glib/-/issues/2140 with some adjustments. Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/263
* spawn: Use unique_ptr for child setup dataChristian Persch2020-05-031-4/+4
|
* spawn: Fix double-calling of the child setup data destructorChristian Persch2020-05-011-11/+7
| | | | | | | | | | The problem was that after moving the SpawnContext into the SpawnOperation, ~SpawnContext of the move source's context called the child setup data destructor but the data now belongs to the move target. Fix this by using a std::shared_ptr. Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/237
* spawn: Don't try to call null callbackChristian Persch2020-05-011-6/+6
|
* spawn: Remove debug leftoversChristian Persch2020-05-011-2/+0
|
* spawn: Remove unused member variablesChristian Persch2020-04-281-2/+0
|
* lib: Move fdwalk fallback implementation to its own fileChristian Persch2020-04-271-0/+1
|
* spawn: Allow passing file descriptors to the child processChristian Persch2020-04-271-2/+46
| | | | | | | | | | Add vte_pty_spawn_with_fds_async() and vte_terminal_spawn_with_fds_async() that take an array of file descriptors, and an array of integers specifying where to assign the file descriptors to in the child process. This also fixes the equivalent of gspawn/gsubprocess bug https://gitlab.gnome.org/GNOME/glib/-/issues/2097 when using these new functions (e.g. in gnome-terminal).
* spawn: Rework spawningChristian Persch2020-04-271-0/+213
The old spawning code was copied from glib, and used a thread to make the synchronous variant into an asynchronous one. This had the problem that fork(3p) was called from the worker thread, not the calling (main) thread. The new code replaces this with a two-stage approach where the fork takes place on the calling thread, and only the async wait for the child error is done in a worker thread. This also unifies the sync and async spawn variants to use the exact same code, only called in one or two stages. This also removes calls to setenv/unsetenv from the child setup code, which are not safe to do there. Instead, the environment is prepared in advance and used via execve(2). Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/118