Convert the struct pollfd *fds to be allocated rather than residing
on the stack. This prepares it for the next patch where the size of
the array of fds becomes dynamic.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
size_t inlen = 0, outlen = 0, errlen = 0;
size_t inoff = 0;
int ret = 0;
+ VIR_AUTOFREE(struct pollfd *) fds = NULL;
if (dryRunBuffer || dryRunCallback) {
VIR_DEBUG("Dry run requested, skipping I/O processing");
goto cleanup;
ret = -1;
+ if (VIR_ALLOC_N(fds, 3) < 0)
+ goto cleanup;
+
for (;;) {
size_t i;
- struct pollfd fds[3];
int nfds = 0;
if (cmd->inpipe != -1) {