tevent: use struct initializers for tevent_fd
authorStefan Metzmacher <metze@samba.org>
Thu, 23 Oct 2014 05:15:14 +0000 (07:15 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 11 Jul 2018 21:04:18 +0000 (23:04 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/tevent/tevent_fd.c

index 455961b67c840db4dc90606b039030eb1ccf308d..f33ae841b3964324fb4a43319591f824f756a6c8 100644 (file)
@@ -60,16 +60,15 @@ struct tevent_fd *tevent_common_add_fd(struct tevent_context *ev, TALLOC_CTX *me
        fde = talloc(mem_ctx?mem_ctx:ev, struct tevent_fd);
        if (!fde) return NULL;
 
-       fde->event_ctx          = ev;
-       fde->fd                 = fd;
-       fde->flags              = flags;
-       fde->handler            = handler;
-       fde->close_fn           = NULL;
-       fde->private_data       = private_data;
-       fde->handler_name       = handler_name;
-       fde->location           = location;
-       fde->additional_flags   = 0;
-       fde->additional_data    = NULL;
+       *fde = (struct tevent_fd) {
+               .event_ctx      = ev,
+               .fd             = fd,
+               .flags          = flags,
+               .handler        = handler,
+               .private_data   = private_data,
+               .handler_name   = handler_name,
+               .location       = location,
+       };
 
        DLIST_ADD(ev->fd_events, fde);