Fix wrong use of the EBADFD errno
authorCismonX <admin@cismon.net>
Thu, 20 Jun 2024 20:36:47 +0000 (04:36 +0800)
committerBernd Schubert <bernd.schubert@fastmail.fm>
Tue, 25 Jun 2024 05:16:49 +0000 (07:16 +0200)
should use EBADF instead

example/notify_inval_inode.c
example/notify_store_retrieve.c

index de88c87e71a51e674eefbdc1bfd5c74e2c8038e1..db24335cb0c0a226355f6c5ce696b4c6d9ec23d9 100644 (file)
@@ -287,14 +287,14 @@ static void* update_fs_loop(void *data) {
         if (!options.no_notify && lookup_cnt) {
             /* Only send notification if the kernel is aware of the inode */
 
-            /* Some errors (ENOENT, EBADFD, ENODEV) have to be accepted as the
+            /* Some errors (ENOENT, EBADF, ENODEV) have to be accepted as they
              * might come up during umount, when kernel side already releases
              * all inodes, but does not send FUSE_DESTROY yet.
              */
             int ret =
                 fuse_lowlevel_notify_inval_inode(se, FILE_INO, 0, 0);
             if ((ret != 0 && !is_stop) &&
-                 ret != -ENOENT && ret != -EBADFD && ret != -ENODEV) {
+                 ret != -ENOENT && ret != -EBADF && ret != -ENODEV) {
                 fprintf(stderr,
                         "ERROR: fuse_lowlevel_notify_store() failed with %s (%d)\n",
                         strerror(-ret), -ret);
index 7145bf49a10907bc5ab8be8e7a5f132e99fbe26d..7669612ea033143429b57fc9897b372263f4b464 100644 (file)
@@ -353,14 +353,14 @@ static void* update_fs_loop(void *data) {
             bufv.buf[0].flags = 0;
 
             /*
-             * Some errors (ENOENT, EBADFD, ENODEV) have to be accepted as they
+             * Some errors (ENOENT, EBADF, ENODEV) have to be accepted as they
              * might come up during umount, when kernel side already releases
              * all inodes, but does not send FUSE_DESTROY yet.
              */
 
             ret = fuse_lowlevel_notify_store(se, FILE_INO, 0, &bufv, 0);
             if ((ret != 0 && !is_umount) &&
-                ret != -ENOENT && ret != -EBADFD && ret != -ENODEV) {
+                ret != -ENOENT && ret != -EBADF && ret != -ENODEV) {
                 fprintf(stderr,
                         "ERROR: fuse_lowlevel_notify_store() failed with %s (%d)\n",
                         strerror(-ret), -ret);
@@ -371,7 +371,7 @@ static void* update_fs_loop(void *data) {
                kernel to send us back the stored data */
             ret = fuse_lowlevel_notify_retrieve(se, FILE_INO, MAX_STR_LEN,
                                                 0, (void*) strdup(file_contents));
-            assert((ret == 0 || is_umount) || ret == -ENOENT || ret == -EBADFD ||
+            assert((ret == 0 || is_umount) || ret == -ENOENT || ret == -EBADF ||
                    ret != -ENODEV);
             if(retrieve_status == 0)
                 retrieve_status = 1;