Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152615346
D51118.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
771 B
Referenced Files
None
Subscribers
None
D51118.diff
View Options
diff --git a/lib/libc/gen/opendir2.c b/lib/libc/gen/opendir2.c
--- a/lib/libc/gen/opendir2.c
+++ b/lib/libc/gen/opendir2.c
@@ -243,20 +243,18 @@
return (true);
}
+/*
+ * Return true if the file descriptor is associated with a file from a
+ * union file system or from a file system mounted with the union flag.
+ */
static bool
is_unionstack(int fd)
{
- int unionstack;
-
- unionstack = _fcntl(fd, F_ISUNIONSTACK, 0);
- if (unionstack != -1)
- return (unionstack);
-
/*
- * Should not happen unless running on a kernel without the op,
- * but no use rendering the system useless in such a case.
+ * This call shouldn't fail, but if it does, just assume that the
+ * answer is no.
*/
- return (0);
+ return (_fcntl(fd, F_ISUNIONSTACK, 0) > 0);
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 17, 12:45 AM (14 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31630982
Default Alt Text
D51118.diff (771 B)
Attached To
Mode
D51118: opendir: Simplify is_unionstack().
Attached
Detach File
Event Timeline
Log In to Comment