Skip to content

Commit

Permalink
lumix: read file size from hash table
Browse files Browse the repository at this point in the history
  • Loading branch information
William Wilhelm committed May 26, 2020
1 parent ea2813d commit 628d997
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gphotofs.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ gphotofs_getattr(const char *path,
gpointer value;
guint i;
int event_ret = 0;
OpenFile *openFile;
unsigned long int dataSize;

event_ret = gphotofs_check_events();
if (event_ret == GP_ERROR_IO_USB_FIND || event_ret == GP_ERROR_MODEL_NOT_FOUND)
Expand Down Expand Up @@ -349,12 +351,15 @@ gphotofs_getattr(const char *path,
}
}

openFile = g_hash_table_lookup(p->reads, path);
if (openFile) gp_file_get_data_and_size(openFile->file, NULL, &dataSize);

if (mystbuf) {
stbuf->st_mode = mystbuf->st_mode;
stbuf->st_nlink = mystbuf->st_nlink;
stbuf->st_uid = mystbuf->st_uid;
stbuf->st_gid = mystbuf->st_gid;
stbuf->st_size = mystbuf->st_size;
stbuf->st_size = dataSize;
stbuf->st_blocks = mystbuf->st_blocks;
stbuf->st_mtime = mystbuf->st_mtime;
} else {
Expand Down

0 comments on commit 628d997

Please sign in to comment.