[systemd-devel] [PATCH v2 19/26] dhcp: Add timeout and main loop support
Lennart Poettering
lennart at poettering.net
Mon Nov 25 15:15:59 PST 2013
On Mon, 25.11.13 09:13, Patrik Flykt (patrik.flykt at linux.intel.com) wrote:
> -DHCPClient *sd_dhcp_client_new(void)
> +DHCPClient *sd_dhcp_client_new(sd_event *event)
> {
> DHCPClient *client;
>
> + assert_return(event, NULL);
> +
> client = new0(DHCPClient, 1);
> if (!client)
> return NULL;
>
> + client->event = event;
You should probably take a reference here with sd_event_ref(), and then
unref it again in your destructor.
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list