|
Description
|
As noted by Casper in ON bug 6346809:
The st_mode field of "struct stat" includes a field which is the type of the file.
This type field is several bits wide but since each file can have only one type,
it's not a bit mask; it's a value.
Unfortunately, not all programmers are aware of this and rather than using:
S_ISDIR(st_mode)
or
(st_mode & S_IFMT) == S_IFDIR
they use constructs like:
st_mode & S_IFCHR (which is also true for block devices, event ports and sockets)
(st_mode & S_IFDIR ) == S_IFDIR (close but no cigar)
Misuse of these in the Xorg codebase is being fixed in Xorg 6.9 under
https://bugs.freedesktop.org/show_bug.cgi?id=5003
There are a number of places in the rest of the Solaris X code base this needs to be fixed
though.
|