Skip to content
Commit c951c86b authored by David Matlack's avatar David Matlack Committed by Radim Krčmář
Browse files

api: fix "ignoring return value" of posix_memalign errors



posix_memalign returns zero on success and an errno value otherwise. The
value of the global variable "errno" is actually indeterminiate after a
call to posix_memalign(), according to the man page.

This patch also fixes the compilation errors:

api/dirty-log.cc:55:50: error: ignoring return value of ‘int posix_memalign(void**, size_t, size_t)’, declared with attribute warn_unused_result [-Werror=unused-result]
     posix_memalign(&logged_slot_virt, 4096, 4096);

api/identity.cc:23:41: error: ignoring return value of ‘int posix_memalign(void**, size_t, size_t)’, declared with attribute warn_unused_result [-Werror=unused-result]
     posix_memalign(&tss, 4096, 4 * 4096);

Signed-off-by: default avatarDavid Matlack <dmatlack@google.com>
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
parent dd3de932
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment