projects
/
rrq
/
fusefile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9c63c2c
)
bug fix EOF handling
author
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Sat, 16 Jul 2022 10:11:50 +0000
(20:11 +1000)
committer
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Sat, 16 Jul 2022 10:11:50 +0000
(20:11 +1000)
fusefile.c
patch
|
blob
|
history
diff --git
a/fusefile.c
b/fusefile.c
index a976660e29fb56a5c73297e27e24ab0e212db5a7..a0f09818da187d7958c75d6117ef5ed6bdebd06c 100644
(file)
--- a/
fusefile.c
+++ b/
fusefile.c
@@
-217,7
+217,7
@@
static int fusefile_read(const char *path, char *buf, size_t size,
#endif
int i = find_source( off );
if ( i < 0 ) {
#endif
int i = find_source( off );
if ( i < 0 ) {
- return ( off == sources.size )?
0
: -ENOENT;
+ return ( off == sources.size )?
rr
: -ENOENT;
}
if ( sources.array[i].fd < 0 ) {
return -ENOENT;
}
if ( sources.array[i].fd < 0 ) {
return -ENOENT;
@@
-256,6
+256,25
@@
static int fusefile_read(const char *path, char *buf, size_t size,
return rr;
}
return rr;
}
+/**
+ * Poll for IO readiness.
+ */
+int fusefile_poll(const char *path, struct fuse_file_info *fi,
+ struct fuse_pollhandle *ph, unsigned *reventsp )
+{
+#if DEBUG
+ fprintf( stderr, "fusefile_poll( %s ) %p %d\n", path, ph, *reventsp );
+#endif
+ if( strcmp( path, "/" ) != 0 ) {
+ return -ENOENT;
+ }
+ if ( ph ) {
+ return fuse_notify_poll( ph );
+ }
+ return 0;
+}
+
+
/**
* Write a full block of data over the sources at the offset
*/
/**
* Write a full block of data over the sources at the offset
*/
@@
-397,6
+416,7
@@
static struct fuse_operations fusefile_oper = {
.chmod = fusefile_chmod,
.open = fusefile_open,
.read = fusefile_read,
.chmod = fusefile_chmod,
.open = fusefile_open,
.read = fusefile_read,
+ .poll = fusefile_poll,
.write = fusefile_write,
.write_buf = fusefile_write_buf,
.destroy = fusefile_destroy,
.write = fusefile_write,
.write_buf = fusefile_write_buf,
.destroy = fusefile_destroy,