mirror of
https://github.com/libretro/hatari.git
synced 2026-11-07 10:36:00 -10:00
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:
1 parent
7a9bee6766
commit
2223fd5c01
1 file changed
+3
@@ -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(×pec), name);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user