Add UTIME/SYS_UTIME checks

Some systems might have neither of this header, and in this case
we cannot use utime(). Thanks to Craig Carnell for the hint!
This commit is contained in:
Thomas Huth committed 2026-10-31 09:12:05 +01:00
1 parent 7a9bee6766
commit 2223fd5c01
1 file changed
+3
+3
View File
@@ -237,6 +237,7 @@ static bool GemDOS_GetFileInformation(int Handle, DATETIME *DateTime)
*/
static bool GemDOS_SetFileInformation(int Handle, DATETIME *DateTime)
{
#if HAVE_UTIME_H || HAVE_SYS_UTIME_H
const char *filename;
struct utimbuf timebuf;
struct stat filestat;
@@ -275,6 +276,8 @@ static bool GemDOS_SetFileInformation(int Handle, DATETIME *DateTime)
if (utime(filename, &timebuf) != 0)
return false;
// fprintf(stderr, "set date '%s' for %s\n", asctime(&timespec), name);
#endif
return true;
}