]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
fanotify.7: Clarify logic in ESTALE check
authorMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 8 Jun 2019 10:32:17 +0000 (12:32 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 8 Jun 2019 11:56:00 +0000 (13:56 +0200)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man7/fanotify.7

index 5b9d5ff95de5cbaf39bdff7aea23fe1bf60e5b1c..a4c522bd2867d7f5c738bb909f1d826f24cd381a 100644 (file)
@@ -1065,13 +1065,15 @@ main(int argc, char **argv)
            deleted for the object prior to this system call. */
 
         event_fd = open_by_handle_at(AT_FDCWD, file_handle, O_RDONLY);
-        if (ret == \-1 && errno == ESTALE) {
-            printf("File handle is no longer valid. "
-                    "File has been deleted\e\n");
-            continue;
-        } else if (ret == \-1) {
-            perror("open_by_handle_at");
-            exit(EXIT_FAILURE);
+        if (ret == \-1) {
+            if (errno == ESTALE) {
+                printf("File handle is no longer valid. "
+                        "File has been deleted\e\n");
+                continue;
+            } else {
+                perror("open_by_handle_at");
+                exit(EXIT_FAILURE);
+           }
         }
 
         snprintf(procfd_path, sizeof(procfd_path), "/proc/self/fd/%d",