Build fix: poll compatibility mode: zmalloc prototype changed
[lttng-tools.git] / src / common / compat / poll.cpp
index 0617905a6ee65e37656956b650a41838cb9e1393..dfe05d59eec70afd3aaf6e9daffe83f733ac5132 100644 (file)
@@ -455,17 +455,17 @@ int compat_poll_create(struct lttng_poll_event *events, int size)
        wait = &events->wait;
 
        /* This *must* be freed by using lttng_poll_free() */
-       wait->events = (struct pollfd *) zmalloc(size * sizeof(struct pollfd));
+       wait->events = calloc<struct pollfd>(size);
        if (wait->events == NULL) {
-               PERROR("zmalloc struct pollfd");
+               PERROR("Failed to allocate wait events array during poll initialization");
                goto error;
        }
 
        wait->alloc_size = wait->init_size = size;
 
-       current->events = (struct pollfd *) zmalloc(size * sizeof(struct pollfd));
+       current->events = calloc<struct pollfd>(size);
        if (current->events == NULL) {
-               PERROR("zmalloc struct current pollfd");
+               PERROR("Failed to allocate current events array during poll initialization");
                goto error;
        }
 
This page took 0.024494 seconds and 4 git commands to generate.