]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - arch/sandbox/cpu/state.c
sandbox: Prepare API change for files greater than 2GB
[karo-tx-uboot.git] / arch / sandbox / cpu / state.c
index 59adad653c2a9f59741ec0276363ea73eee2a3b2..ba73b7e251040831f45a38d29132479b605c0abc 100644 (file)
@@ -49,14 +49,14 @@ static int state_ensure_space(int extra_size)
 
 static int state_read_file(struct sandbox_state *state, const char *fname)
 {
-       int size;
+       loff_t size;
        int ret;
        int fd;
 
-       size = os_get_filesize(fname);
-       if (size < 0) {
+       ret = os_get_filesize(fname, &size);
+       if (ret < 0) {
                printf("Cannot find sandbox state file '%s'\n", fname);
-               return -ENOENT;
+               return ret;
        }
        state->state_fdt = os_malloc(size);
        if (!state->state_fdt) {