summaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/fileio.c14
-rw-r--r--src/helper/fileio.h2
2 files changed, 13 insertions, 3 deletions
diff --git a/src/helper/fileio.c b/src/helper/fileio.c
index 7c862e47..9ae01344 100644
--- a/src/helper/fileio.c
+++ b/src/helper/fileio.c
@@ -245,8 +245,18 @@ int fileio_write_u32(struct fileio *fileio_p, uint32_t data)
return retval;
}
-int fileio_size(struct fileio *fileio_p)
+/**
+ * FIX!!!!
+ *
+ * For now this can not fail, but that's because a seek was executed
+ * on startup.
+ *
+ * Avoiding the seek on startup opens up for using streams.
+ *
+ */
+int fileio_size(struct fileio *fileio_p, int *size)
{
struct fileio_internal *fileio = fileio_p->fp;
- return fileio->size;
+ *size = fileio->size;
+ return ERROR_OK;
}
diff --git a/src/helper/fileio.h b/src/helper/fileio.h
index 40c4ef0e..fa499ab7 100644
--- a/src/helper/fileio.h
+++ b/src/helper/fileio.h
@@ -66,7 +66,7 @@ int fileio_write(struct fileio *fileio,
int fileio_read_u32(struct fileio *fileio, uint32_t *data);
int fileio_write_u32(struct fileio *fileio, uint32_t data);
-int fileio_size(struct fileio *fileio);
+int fileio_size(struct fileio *fileio, int *size);
#define ERROR_FILEIO_LOCATION_UNKNOWN (-1200)
#define ERROR_FILEIO_NOT_FOUND (-1201)