diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2017-05-31 12:54:19 -0700 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2017-05-31 12:54:19 -0700 |
commit | 7d09db0e46e72ac86123dc8012cf04a35e1c93e3 (patch) | |
tree | 004ea596f03723f6af5745dc8a577008b6cd5466 /example | |
parent | e6dd8ceb9eb066dc9a05fa6de32cca51eef76977 (diff) |
example/notify_store_retrieve: add debugging code for issue #105.
Diffstat (limited to 'example')
-rw-r--r-- | example/notify_store_retrieve.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/example/notify_store_retrieve.c b/example/notify_store_retrieve.c index 440a7f8..0ed22bb 100644 --- a/example/notify_store_retrieve.c +++ b/example/notify_store_retrieve.c @@ -300,6 +300,7 @@ static void update_fs(void) { static void* update_fs_loop(void *data) { struct fuse_session *se = (struct fuse_session*) data; struct fuse_bufvec bufv; + int ret; while(1) { update_fs(); @@ -312,8 +313,15 @@ static void* update_fs_loop(void *data) { bufv.buf[0].size = file_size; bufv.buf[0].mem = file_contents; bufv.buf[0].flags = 0; - assert(fuse_lowlevel_notify_store(se, FILE_INO, 0, - &bufv, 0) == 0); + + /* This shouldn't fail, but apparenly it sometimes + does - see https://github.com/libfuse/libfuse/issues/105 */ + ret = fuse_lowlevel_notify_store(se, FILE_INO, 0, &bufv, 0); + if (ret != 0) { + fprintf(stderr, "ERROR: fuse_lowlevel_notify_store() failed with %s (%d)\n", + strerror(-ret), -ret); + abort(); + } /* To make sure that everything worked correctly, ask the kernel to send us back the stored data */ |