buffer->tail += size;
}
-void
+int
wl_connection_destroy(struct wl_connection *connection)
{
+ int fd = connection->fd;
+
close_fds(&connection->fds_out, -1);
close_fds(&connection->fds_in, -1);
- close(connection->fd);
free(connection);
+
+ return fd;
}
void
const struct wl_interface *iface2);
struct wl_connection *wl_connection_create(int fd);
-void wl_connection_destroy(struct wl_connection *connection);
+int wl_connection_destroy(struct wl_connection *connection);
void wl_connection_copy(struct wl_connection *connection, void *data, size_t size);
void wl_connection_consume(struct wl_connection *connection, size_t size);
wl_map_for_each(&client->objects, destroy_resource, &serial);
wl_map_release(&client->objects);
wl_event_source_remove(client->source);
- wl_connection_destroy(client->connection);
+ close(wl_connection_destroy(client->connection));
wl_list_remove(&client->link);
free(client);
}
connection = setup(s);
wl_connection_destroy(connection);
+ close(s[0]);
close(s[1]);
}
assert(memcmp(message, buffer, sizeof message) == 0);
wl_connection_destroy(connection);
+ close(s[0]);
close(s[1]);
}
wl_connection_consume(connection, sizeof message);
wl_connection_destroy(connection);
+ close(s[0]);
close(s[1]);
}
assert(memcmp(message, buffer + sizeof message, sizeof message) == 0);
wl_connection_destroy(connection);
+ close(s[0]);
close(s[1]);
}
static void
release_marshal_data(struct marshal_data *data)
{
- wl_connection_destroy(data->read_connection);
- wl_connection_destroy(data->write_connection);
+ close(wl_connection_destroy(data->read_connection));
+ close(wl_connection_destroy(data->write_connection));
}
static void