diff options
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 5 |
1 files 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 }; } |