tools/libxc: report malloc errors in writev_exact
authorOlaf Hering <olaf@aepfle.de>
Wed, 23 Sep 2020 06:48:40 +0000 (08:48 +0200)
committerWei Liu <wl@xen.org>
Wed, 30 Sep 2020 15:06:38 +0000 (15:06 +0000)
The caller of writev_exact should be notified about malloc errors
when dealing with partial writes.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wl@xen.org>
tools/libs/ctrl/xc_private.c

index 8af96b1b7e602bb381aac81c4098c00aa4621d62..3fab94f9c0d61cc3fe1d7a3a9909503aa39a68e1 100644 (file)
@@ -721,6 +721,7 @@ int writev_exact(int fd, const struct iovec *iov, int iovcnt)
                     if ( !local_iov )
                     {
                         saved_errno = ENOMEM;
+                        rc = -1;
                         goto out;
                     }