From deb839ba6f2bc3cfb388a2ca40999904f2292b7b Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Fri, 6 Jul 2018 14:45:07 +0200 Subject: [PATCH] libc: use 'alloc_aligned()' in fd allocator `Allocator_avl_base::alloc()` now uses address size alignment, so `Allocator_avl_base::alloc_aligned()` must be used for 1-byte alignment. Fixes #2915 --- repos/libports/src/lib/libc/fd_alloc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/libports/src/lib/libc/fd_alloc.cc b/repos/libports/src/lib/libc/fd_alloc.cc index 7b4be72f09..b53a443311 100644 --- a/repos/libports/src/lib/libc/fd_alloc.cc +++ b/repos/libports/src/lib/libc/fd_alloc.cc @@ -59,7 +59,7 @@ File_descriptor *File_descriptor_allocator::alloc(Plugin *plugin, /* allocate fresh fd if the default value for 'libc_fd' was specified */ bool alloc_ok = false; if (libc_fd <= ANY_FD) - alloc_ok = Allocator_avl_base::alloc(1, reinterpret_cast(&addr)); + alloc_ok = Allocator_avl_base::alloc_aligned(1, reinterpret_cast(&addr), 0).ok(); else alloc_ok = (Allocator_avl_base::alloc_addr(1, addr).ok());