X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpagealign_alloc.c;h=c06dd0da4fab015859c34b08dfc108dcb91945ab;hb=48d53bec760cf91fc9ade0c67cd78ef7094bba50;hp=ab36c932f8586f1e753eb03b3687d0a5beeba63a;hpb=267a39bafd249d7eb9c37df06dc6defcf41cb343;p=gnulib.git diff --git a/lib/pagealign_alloc.c b/lib/pagealign_alloc.c index ab36c932f..c06dd0da4 100644 --- a/lib/pagealign_alloc.c +++ b/lib/pagealign_alloc.c @@ -1,6 +1,6 @@ /* Memory allocation aligned to system page boundaries. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -19,22 +19,15 @@ /* Written by Derek R. Price . */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include "pagealign_alloc.h" #include #include -#if HAVE_FCNTL_H -# include -#endif - -#if HAVE_UNISTD_H -# include -#endif +#include +#include #if HAVE_MMAP # include @@ -59,6 +52,11 @@ # endif #endif +/* The results of open() in this file are not used with fchdir, + therefore save some unnecessary work in fchdir.c. */ +#undef open +#undef close + #if HAVE_MMAP || ! HAVE_POSIX_MEMALIGN @@ -88,7 +86,7 @@ static memnode_t *memnode_table = NULL; static void new_memnode (void *aligned_ptr, info_t info) { - memnode_t *new_node = (memnode_t *) xmalloc (sizeof (memnode_t)); + memnode_t *new_node = XMALLOC (memnode_t); new_node->aligned_ptr = aligned_ptr; new_node->info = info; new_node->next = memnode_table;