util: iohelper: Don't handle OOM from posix_memalign

Similarly to other allocation calls abort() on failure.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Peter Krempa 2021-02-23 17:15:08 +01:00
parent cc622f5548
commit dda78f0b62

View File

@ -27,6 +27,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include "virthread.h"
#include "virfile.h"
@ -57,10 +58,8 @@ runIO(const char *path, int fd, int oflags)
off_t end = 0;
#if WITH_POSIX_MEMALIGN
if (posix_memalign(&base, alignMask + 1, buflen)) {
virReportOOMError();
goto cleanup;
}
if (posix_memalign(&base, alignMask + 1, buflen))
abort();
buf = base;
#else
buf = g_new0(char, buflen + alignMask);