aboutsummaryrefslogtreecommitdiff
path: root/src/fileutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fileutils.c')
-rw-r--r--src/fileutils.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/fileutils.c b/src/fileutils.c
index 131472b..7f85ba8 100644
--- a/src/fileutils.c
+++ b/src/fileutils.c
@@ -25,9 +25,8 @@ int file_get_content(const char *filepath, char **data, long *size) {
int result = 0;
FILE *file = fopen(filepath, "rb");
if(!file) {
- int err = -errno;
/*perror(filepath);*/
- return err;
+ return -1;
}
fseek(file, 0, SEEK_END);
@@ -157,16 +156,15 @@ int file_exists(const char *path) {
int create_lock_file(const char *path) {
int fd = open(path, O_CREAT | O_EXCL | O_SYNC, 0666);
if(fd == -1)
- return errno;
+ return -1;
return close(fd);
}
int file_overwrite(const char *filepath, const char *data, size_t size) {
FILE *file = fopen(filepath, "wb");
if(!file) {
- int err = -errno;
perror(filepath);
- return err;
+ return -1;
}
unsigned long bytes_written = fwrite(data, 1, size, file);