From fd276bcf70bad4520ca1d6f3c73f88073b3b58cf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 13 Nov 2020 10:52:56 +0100 Subject: Move fopen wrapper to world --- src/system.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src/system.c') diff --git a/src/system.c b/src/system.c index 6bc93ca6..4f6c37c6 100644 --- a/src/system.c +++ b/src/system.c @@ -14,41 +14,19 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define _POSIX_C_SOURCE 200809L /* for posix_memalign and posix_fadvise */ +#define _POSIX_C_SOURCE 200809L /* for posix_memalign */ #include "system.h" #include "serd_config.h" #include "serd_internal.h" -#if USE_POSIX_FADVISE && USE_FILENO -# include -#endif - #ifdef _WIN32 # include #endif -#include #include #include -#include - -FILE* -serd_fopen(const char* path, const char* mode) -{ - FILE* fd = fopen(path, mode); - if (!fd) { - fprintf( - stderr, "error: failed to open file %s (%s)\n", path, strerror(errno)); - return NULL; - } - -#if USE_POSIX_FADVISE && USE_FILENO - posix_fadvise(fileno(fd), 0, 0, POSIX_FADV_SEQUENTIAL); -#endif - return fd; -} void* serd_malloc_aligned(const size_t alignment, const size_t size) -- cgit v1.2.1