From db229819366c70bbc45a8dfd657d4214358f61d2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 16 Nov 2013 20:05:42 +0100 Subject: fastd_buffer_alloc: fix output of error message if posix_memalign fails --- src/fastd.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fastd.h b/src/fastd.h index 4e17cb5..5354871 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -437,8 +437,9 @@ static inline size_t alignto(size_t l, size_t a) { static inline fastd_buffer_t fastd_buffer_alloc(const fastd_context_t *ctx, size_t len, size_t head_space, size_t tail_space) { size_t base_len = head_space+len+tail_space; void *ptr; - if (posix_memalign(&ptr, 16, base_len)) - exit_errno(ctx, "posix_memalign"); + int err = posix_memalign(&ptr, 16, base_len); + if (err) + exit_error(ctx, "posix_memalign: %s", strerror(err)); return (fastd_buffer_t){ .base = ptr, .base_len = base_len, .data = ptr+head_space, .len = len }; } -- cgit v1.2.3