From 27da3a8634b4ff3fd3ad6ba805ae60f392db2b22 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Thu, 7 Apr 2022 15:44:17 -0300 Subject: [PATCH] Virtual ISO: Make the birthtime check a bit more readable --- src/cdrom/cdrom_image_viso.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cdrom/cdrom_image_viso.c b/src/cdrom/cdrom_image_viso.c index 950228bc7..2b4dfcb76 100644 --- a/src/cdrom/cdrom_image_viso.c +++ b/src/cdrom/cdrom_image_viso.c @@ -531,14 +531,13 @@ viso_fill_dir_record(uint8_t *data, viso_entry_t *entry, int format, int type) VISO_LBE_32(p, dev); /* device number (low 32 bits) */ } #endif - int times = (VISO_TIME_VALID(entry->stats.st_mtime) << 1) | /* modify */ - (VISO_TIME_VALID(entry->stats.st_atime) << 2) | /* access */ - (VISO_TIME_VALID(entry->stats.st_ctime) << 3) | /* attributes */ + int times = #ifdef st_birthtime - (VISO_TIME_VALID(entry->stats.st_birthtime) << 0); /* creation (assume the platform remaps st_birthtime to something else) */ -#else - 0; + (VISO_TIME_VALID(entry->stats.st_birthtime) << 0) | /* creation (hack: assume the platform remaps st_birthtime at header level) */ #endif + (VISO_TIME_VALID(entry->stats.st_mtime) << 1) | /* modify */ + (VISO_TIME_VALID(entry->stats.st_atime) << 2) | /* access */ + (VISO_TIME_VALID(entry->stats.st_ctime) << 3); /* attributes */ if (times) { *q |= 0x80; /* TF = timestamps */ *p++ = 'T';