seatd: Remove unused device_closed msg body

This commit is contained in:
Kenny Levinsen 2020-08-30 03:26:32 +02:00
parent c36cc962e6
commit e86c9ec2b7
3 changed files with 3 additions and 14 deletions

View file

@ -54,11 +54,6 @@ struct proto_server_device_opened {
// One fd in auxillary data // One fd in auxillary data
}; };
// TODO: Content unused, remove before 0.3.0
struct proto_server_device_closed {
int device_id;
};
struct proto_server_error { struct proto_server_error {
int error_code; int error_code;
}; };

View file

@ -478,9 +478,7 @@ static int close_device(struct libseat *base, int device_id) {
return -1; return -1;
} }
struct proto_server_device_closed rmsg; if (read_header(backend, SERVER_DEVICE_CLOSED, 0, false) == SIZE_MAX) {
if (read_header(backend, SERVER_DEVICE_CLOSED, sizeof rmsg, false) == SIZE_MAX ||
conn_get(backend, &rmsg, sizeof rmsg) == -1) {
return -1; return -1;
} }

View file

@ -250,16 +250,12 @@ static int handle_close_device(struct client *client, int device_id) {
goto fail; goto fail;
} }
struct proto_server_device_closed msg = {
.device_id = device_id,
};
struct proto_header header = { struct proto_header header = {
.opcode = SERVER_DEVICE_CLOSED, .opcode = SERVER_DEVICE_CLOSED,
.size = sizeof msg, .size = 0,
}; };
if (connection_put(&client->connection, &header, sizeof header) == -1 || if (connection_put(&client->connection, &header, sizeof header) == -1) {
connection_put(&client->connection, &msg, sizeof msg)) {
log_errorf("unable to write response: %s", strerror(errno)); log_errorf("unable to write response: %s", strerror(errno));
return -1; return -1;
} }