cache ENOSYS on some optional functions
diff --git a/lib/fuse.c b/lib/fuse.c
index 255a24b..05d9713 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -980,8 +980,7 @@
     res = -ENOENT;
     path = get_path(f, in->ino);
     if(path != NULL) {
-        /* fsync is not mandatory, so don't return ENOSYS */
-        res = 0;
+        res = -ENOSYS;
         if(f->op.fsync)
             res = f->op.fsync(path, inarg->datasync);
         free(path);
@@ -1000,7 +999,7 @@
     res = -ENOENT;
     path = get_path(f, in->ino);
     if (path != NULL) {
-        res = -EOPNOTSUPP; /* or is it ENOTSUPP ??? */
+        res = -ENOSYS;
         if (f->op.setxattr)
             res = f->op.setxattr(path, name, value, arg->size, arg->flags);
         free(path);
@@ -1017,7 +1016,7 @@
     res = -ENOENT;
     path = get_path(f, in->ino);
     if (path != NULL) {
-        res = -EOPNOTSUPP; /* or is it ENOTSUPP ??? */
+        res = -ENOSYS;
         if (f->op.getxattr)
             res = f->op.getxattr(path, name, value, size);
         free(path);
@@ -1081,7 +1080,7 @@
     res = -ENOENT;
     path = get_path(f, in->ino);
     if (path != NULL) {
-        res = -EOPNOTSUPP; /* or is it ENOTSUPP ??? */
+        res = -ENOSYS;
         if (f->op.listxattr)
             res = f->op.listxattr(path, list, size);
         free(path);
@@ -1142,7 +1141,7 @@
     res = -ENOENT;
     path = get_path(f, in->ino);
     if (path != NULL) {
-        res = -EOPNOTSUPP; /* or is it ENOTSUPP ??? */
+        res = -ENOSYS;
         if (f->op.removexattr)
             res = f->op.removexattr(path, name);
         free(path);