seat_cmd_attach: defer while reading

Since the seats and inputs are not yet available while the config is
being read, defer seat attachment requests
This commit is contained in:
Brian Ashworth 2019-02-02 02:42:10 -05:00 committed by emersion
parent 0952c9f91d
commit 1bd7400c4d

View file

@ -12,6 +12,9 @@ struct cmd_results *seat_cmd_attach(int argc, char **argv) {
if (!config->handler_context.seat_config) { if (!config->handler_context.seat_config) {
return cmd_results_new(CMD_FAILURE, "No seat defined"); return cmd_results_new(CMD_FAILURE, "No seat defined");
} }
if (config->reading) {
return cmd_results_new(CMD_DEFER, NULL);
}
struct seat_attachment_config *attachment = seat_attachment_config_new(); struct seat_attachment_config *attachment = seat_attachment_config_new();
if (!attachment) { if (!attachment) {