aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-04-30 20:47:16 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-05-04 08:40:38 +0000
commita1b41bd186147f3f028030e9079821d0bfa7b3f6 (patch)
tree05796d4fbef7a5d8838f9331e52dd2b28dd5b508 /server.c
parentMerge branch 'beam-thickness' (diff)
foot/footclient: use a custom exit code when foot/footclient fail to run
Normally, foot and footclient uses the exit code from the client application (i.e. the shell). However, foot (or footclient) itself may fail to run; if run outside of a Wayland session, or no fonts are installed, or the client application/shell cannot be found (“foot lsdjfldsjf”) etc. Up until now, there has been no way to differentiate these kind of failures from the client application exiting with code 1. This patch changes foot’s failure exit code to -27/229, and footclient’s to -28/228. Note that footclient will exit with foot’s -27/229 if footclient ran successfully, but the foot server failed to instantiate a new window. Closes #466.
Diffstat (limited to 'server.c')
-rw-r--r--server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/server.c b/server.c
index 2d813ab2..6a86bae2 100644
--- a/server.c
+++ b/server.c
@@ -312,7 +312,7 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
if (instance->terminal == NULL) {
LOG_ERR("failed to instantiate new terminal");
- client_send_exit_code(client, -1);
+ client_send_exit_code(client, -27);
instance_destroy(instance, -1);
goto shutdown;
}
@@ -497,7 +497,7 @@ server_destroy(struct server *server)
tll_length(server->clients));
tll_foreach(server->clients, it) {
- client_send_exit_code(it->item, 1);
+ client_send_exit_code(it->item, -27);
client_destroy(it->item);
}