mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-09 08:21:01 -04:00
server: no need to clone the config to handle -N,--no-wait
This commit is contained in:
parent
26859a5168
commit
f39a62fa5e
2 changed files with 2 additions and 7 deletions
1
config.h
1
config.h
|
|
@ -70,7 +70,6 @@ struct config {
|
||||||
char *app_id;
|
char *app_id;
|
||||||
wchar_t *word_delimiters;
|
wchar_t *word_delimiters;
|
||||||
bool login_shell;
|
bool login_shell;
|
||||||
bool no_wait;
|
|
||||||
bool locked_title;
|
bool locked_title;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
|
||||||
8
server.c
8
server.c
|
|
@ -277,16 +277,12 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
|
||||||
|
|
||||||
const bool need_to_clone_conf =
|
const bool need_to_clone_conf =
|
||||||
tll_length(overrides)> 0 ||
|
tll_length(overrides)> 0 ||
|
||||||
cdata.hold != server->conf->hold_at_exit ||
|
cdata.hold != server->conf->hold_at_exit;
|
||||||
cdata.no_wait != server->conf->no_wait;
|
|
||||||
|
|
||||||
struct config *conf = NULL;
|
struct config *conf = NULL;
|
||||||
if (need_to_clone_conf) {
|
if (need_to_clone_conf) {
|
||||||
conf = config_clone(server->conf);
|
conf = config_clone(server->conf);
|
||||||
|
|
||||||
if (cdata.no_wait != server->conf->no_wait)
|
|
||||||
conf->no_wait = cdata.no_wait;
|
|
||||||
|
|
||||||
if (cdata.hold != server->conf->hold_at_exit)
|
if (cdata.hold != server->conf->hold_at_exit)
|
||||||
conf->hold_at_exit = cdata.hold;
|
conf->hold_at_exit = cdata.hold;
|
||||||
|
|
||||||
|
|
@ -317,7 +313,7 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
|
||||||
goto shutdown;
|
goto shutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conf != NULL && conf->no_wait) {
|
if (cdata.no_wait) {
|
||||||
// the server owns the instance
|
// the server owns the instance
|
||||||
tll_push_back(server->terminals, instance);
|
tll_push_back(server->terminals, instance);
|
||||||
client_send_exit_code(client, 0);
|
client_send_exit_code(client, 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue