aboutsummaryrefslogtreecommitdiff
path: root/seatd
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-11-21 02:18:45 +0100
committerKenny Levinsen <kl@kl.wtf>2021-02-27 19:35:15 +0100
commitff38ea595af7bdac330b44b01443742c015bf426 (patch)
tree378445778f70e78e0524447b7a6fad9c66d21bf7 /seatd
parent6cf751af2b0313bc9b78ea9e56dc72ec91325935 (diff)
seatd: Set errno in seat_add_client
Diffstat (limited to 'seatd')
-rw-r--r--seatd/seat.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/seatd/seat.c b/seatd/seat.c
index 3e134b1..4def100 100644
--- a/seatd/seat.c
+++ b/seatd/seat.c
@@ -139,16 +139,19 @@ int seat_add_client(struct seat *seat, struct client *client) {
if (client->seat != NULL) {
log_error("cannot add client: client is already a member of a seat");
+ errno = EBUSY;
return -1;
}
if (seat->vt_bound && seat->active_client != NULL) {
log_error("cannot add client: seat is vt_bound and an active client already exists");
+ errno = EBUSY;
return -1;
}
if (client->session != -1) {
log_error("cannot add client: client cannot be reused");
+ errno = EINVAL;
return -1;
}
@@ -156,6 +159,7 @@ int seat_add_client(struct seat *seat, struct client *client) {
seat_update_vt(seat);
if (seat->cur_vt == -1) {
log_error("could not determine VT for client");
+ errno = EINVAL;
return -1;
}
client->session = seat->cur_vt;