Virtual ISO: Make S_ISCHR and S_ISBLK queries less weird
This commit is contained in:
@@ -486,15 +486,13 @@ viso_fill_dir_record(uint8_t *data, viso_entry_t *entry, int type)
|
|||||||
VISO_LBE_32(p, entry->stats.st_uid); /* owner UID */
|
VISO_LBE_32(p, entry->stats.st_uid); /* owner UID */
|
||||||
VISO_LBE_32(p, entry->stats.st_gid); /* owner GID */
|
VISO_LBE_32(p, entry->stats.st_gid); /* owner GID */
|
||||||
|
|
||||||
# if defined(S_ISCHR) || defined(S_ISBLK)
|
# ifndef S_ISCHR
|
||||||
# if defined(S_ISCHR) && defined(S_ISBLK)
|
# define S_ISCHR(x) 0
|
||||||
if (S_ISCHR(entry->stats.st_mode) || S_ISBLK(entry->stats.st_mode))
|
# endif
|
||||||
# elif defined(S_ISCHR)
|
# ifndef S_ISBLK
|
||||||
if (S_ISCHR(entry->stats.st_mode))
|
# define S_ISBLK(x) 0
|
||||||
# else
|
# endif
|
||||||
if (S_ISBLK(entry->stats.st_mode))
|
if (S_ISCHR(entry->stats.st_mode) || S_ISBLK(entry->stats.st_mode)) {
|
||||||
# endif
|
|
||||||
{
|
|
||||||
*q |= 0x02; /* PN = POSIX device */
|
*q |= 0x02; /* PN = POSIX device */
|
||||||
*p++ = 'P';
|
*p++ = 'P';
|
||||||
*p++ = 'N';
|
*p++ = 'N';
|
||||||
@@ -505,7 +503,6 @@ viso_fill_dir_record(uint8_t *data, viso_entry_t *entry, int type)
|
|||||||
VISO_LBE_32(p, dev >> 32); /* device number (high 32 bits) */
|
VISO_LBE_32(p, dev >> 32); /* device number (high 32 bits) */
|
||||||
VISO_LBE_32(p, dev); /* device number (low 32 bits) */
|
VISO_LBE_32(p, dev); /* device number (low 32 bits) */
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
if (VISO_TIME_VALID(entry->stats.st_mtime) || VISO_TIME_VALID(entry->stats.st_atime) || VISO_TIME_VALID(entry->stats.st_ctime)) {
|
if (VISO_TIME_VALID(entry->stats.st_mtime) || VISO_TIME_VALID(entry->stats.st_atime) || VISO_TIME_VALID(entry->stats.st_ctime)) {
|
||||||
*q |= 0x80; /* TF = timestamps */
|
*q |= 0x80; /* TF = timestamps */
|
||||||
|
Reference in New Issue
Block a user