summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-12-19 15:00:51 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-19 07:28:21 -0800
commitfbff6127ac6e4318767bc20c6b0be3051140326a (patch)
tree933e46808667f0723128da3195f89eb87667db99 /file.c
parentf487953ad360b941fe225418cd3e5801d5a6508b (diff)
downloadsubsurface-fbff6127ac6e4318767bc20c6b0be3051140326a.tar.gz
Files: use the new open() wrappers
Adds use of everything from the new wrappers(), but the opendir() one. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r--file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/file.c b/file.c
index 9fd44d90f..8f6dfb080 100644
--- a/file.c
+++ b/file.c
@@ -25,7 +25,7 @@ int readfile(const char *filename, struct memblock *mem)
mem->buffer = NULL;
mem->size = 0;
- fd = open(filename, O_RDONLY | O_BINARY, 0);
+ fd = subsurface_open(filename, O_RDONLY | O_BINARY, 0);
if (fd < 0)
return fd;
ret = fstat(fd, &st);
@@ -81,7 +81,7 @@ static int try_to_open_zip(const char *filename, struct memblock *mem, char **er
{
int success = 0;
/* Grr. libzip needs to re-open the file, it can't take a buffer */
- struct zip *zip = zip_open(filename, ZIP_CHECKCONS, NULL);
+ struct zip *zip = subsurface_zip_open_readonly(filename, ZIP_CHECKCONS, NULL);
if (zip) {
int index;
@@ -93,7 +93,7 @@ static int try_to_open_zip(const char *filename, struct memblock *mem, char **er
zip_fclose(file);
success++;
}
- zip_close(zip);
+ subsurface_zip_close(zip);
}
return success;
}