diff options
author | Dimitri Staessens <[email protected]> | 2023-11-20 17:47:56 +0100 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2023-11-26 15:51:36 +0100 |
commit | 6952f971a8ad78d38b3c6b26b117bffbe55af8ee (patch) | |
tree | 496c1474aa688c67cdecc247c8101b3aae5db56e /src/ipcpd | |
parent | 02e0d64d5d18d9bfc370322e767bd31b4c8bb298 (diff) | |
download | ouroboros-6952f971a8ad78d38b3c6b26b117bffbe55af8ee.tar.gz ouroboros-6952f971a8ad78d38b3c6b26b117bffbe55af8ee.zip |
lib: Fix reading FUSE output on Raspbian
The previous patch only fixed listing the contents on the fuse
filesystem. Apparently files with st_blocks = 0 as seen as empty on
Raspbian, and the FUSE read() function isn't invoked for such
files. Setting st_blocks to 1 fixes that, but st_blksize is ignored
for fuse. So, on raspbian the filesize is now a huge number, but at
least reading the fuse filesystem works.
Corrected the filesystem attributes for the IPCP output for systems
that don't rely on st_blocks to assess filesize.
Also set the file mode to 0644 as these are not executables.
Signed-off-by: Dimitri Staessens <[email protected]>
Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/ipcpd')
-rw-r--r-- | src/ipcpd/ipcp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 617dd11f..e7929d31 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -194,9 +194,13 @@ static int ipcp_rib_readdir(char *** buf) static int ipcp_rib_getattr(const char * path, struct rib_attr * attr) { - (void) path; + char buf[LAYER_NAME_SIZE + 2]; + struct timespec now; - attr->size = LAYER_NAME_SIZE; + clock_gettime(CLOCK_REALTIME_COARSE, &now); + + attr->size = ipcp_rib_read(path, buf, LAYER_NAME_SIZE + 2); + attr->mtime = now.tv_sec; return 0; } |