Skip to content

Commit

Permalink
df: treat ENOTCONN as a reason to skip a filesystem
Browse files Browse the repository at this point in the history
It seems this is returned for FUSE filesystems when they are dead.
  • Loading branch information
q66 committed Jan 5, 2025
1 parent 0184bbb commit 80570a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion patches/src.freebsd.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3312,7 +3312,7 @@
+
+ /* get stat(vfs) fields and copy those over */
+ if (statvfs(ent->mnt_dir, &svfsbuf) == -1 || stat(ent->mnt_dir, &stmnt) == -1) {
+ if ((errno == EACCES) || (errno == EPERM)) continue;
+ if ((errno == EACCES) || (errno == EPERM) || (errno == ENOTCONN)) continue;
+ xo_err(1, "statvfs");
+ }
+
Expand Down
2 changes: 1 addition & 1 deletion src.freebsd/coreutils/df/df.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ getmntinfo(struct mntinfo **mntbuf)

/* get stat(vfs) fields and copy those over */
if (statvfs(ent->mnt_dir, &svfsbuf) == -1 || stat(ent->mnt_dir, &stmnt) == -1) {
if ((errno == EACCES) || (errno == EPERM)) continue;
if ((errno == EACCES) || (errno == EPERM) || (errno == ENOTCONN)) continue;
xo_err(1, "statvfs");
}

Expand Down

0 comments on commit 80570a8

Please sign in to comment.