From 4c52001b54cdd890baf9a2c4b148c2dce892d884 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Thu, 31 Mar 2022 17:14:26 -0300 Subject: [PATCH] Virtual ISO: Make S_ISCHR and S_ISBLK queries less weird --- src/cdrom/cdrom_image_viso.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/cdrom/cdrom_image_viso.c b/src/cdrom/cdrom_image_viso.c index 0c29b45c7..5fadf1cc3 100644 --- a/src/cdrom/cdrom_image_viso.c +++ b/src/cdrom/cdrom_image_viso.c @@ -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_gid); /* owner GID */ -# if defined(S_ISCHR) || defined(S_ISBLK) -# if defined(S_ISCHR) && defined(S_ISBLK) - if (S_ISCHR(entry->stats.st_mode) || S_ISBLK(entry->stats.st_mode)) -# elif defined(S_ISCHR) - if (S_ISCHR(entry->stats.st_mode)) -# else - if (S_ISBLK(entry->stats.st_mode)) -# endif - { +# ifndef S_ISCHR +# define S_ISCHR(x) 0 +# endif +# ifndef S_ISBLK +# define S_ISBLK(x) 0 +# endif + if (S_ISCHR(entry->stats.st_mode) || S_ISBLK(entry->stats.st_mode)) { *q |= 0x02; /* PN = POSIX device */ *p++ = 'P'; *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); /* device number (low 32 bits) */ } -# endif #endif 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 */