diff options
author | David Robillard <d@drobilla.net> | 2020-11-13 10:52:56 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:07 -0500 |
commit | 1a95f759fe3d642e8520e41e691e63f22a2f3b99 (patch) | |
tree | a4a0543b251cf0b0523bfcf2da06c9d92a066d74 /src/system.c | |
parent | a14effc37415540b7b8a1dc6238b350566f273e1 (diff) | |
download | serd-1a95f759fe3d642e8520e41e691e63f22a2f3b99.tar.gz serd-1a95f759fe3d642e8520e41e691e63f22a2f3b99.tar.bz2 serd-1a95f759fe3d642e8520e41e691e63f22a2f3b99.zip |
Move fopen wrapper to world
Diffstat (limited to 'src/system.c')
-rw-r--r-- | src/system.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/system.c b/src/system.c index efd9c7ae..ae9e11bc 100644 --- a/src/system.c +++ b/src/system.c @@ -6,35 +6,14 @@ #include "serd_config.h" #include "serd_internal.h" -#if USE_POSIX_FADVISE && USE_FILENO -# include <fcntl.h> -#endif - #ifdef _WIN32 # include <malloc.h> #endif -#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -FILE* -serd_fopen(const char* const path, const char* const 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 - (void)posix_fadvise(fileno(fd), 0, 0, POSIX_FADV_SEQUENTIAL); -#endif - return fd; -} - void* serd_malloc_aligned(const size_t alignment, const size_t size) { |