Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ typedef struct _EFI_GRUB_FILE {
EFI_FILE EfiFile;
BOOLEAN IsDir;
INT64 DirIndex;
INT32 Mtime;
INT64 Mtime;
CHAR8 *path;
CHAR8 *basename;
INTN RefCount;
Expand Down Expand Up @@ -191,7 +191,7 @@ typedef struct _GRUB_DIRHOOK_INFO {
UINT32 MtimeSet:1;
UINT32 CaseInsensitive:1;
UINT32 InodeSet:1;
INT32 Mtime;
INT64 Mtime;
UINT64 Inode;
} GRUB_DIRHOOK_INFO;

Expand All @@ -217,7 +217,7 @@ extern CHAR16 *GrubGetUuid(EFI_FS *This);
extern BOOLEAN GrubFSProbe(EFI_FS *This);
extern EFI_STATUS GrubDeviceInit(EFI_FS *This);
extern EFI_STATUS GrubDeviceExit(EFI_FS *This);
extern VOID GrubTimeToEfiTime(const INT32 t, EFI_TIME *tp);
extern VOID GrubTimeToEfiTime(const INT64 t, EFI_TIME *tp);
extern VOID CopyPathRelative(CHAR8 *dest, CHAR8 *src, INTN len);
extern EFI_STATUS GrubOpen(EFI_GRUB_FILE *File);
extern EFI_STATUS GrubDir(EFI_GRUB_FILE *File, const CHAR8 *path,
Expand Down
1 change: 0 additions & 1 deletion src/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ DirHook(const CHAR8 *name, const GRUB_DIRHOOK_INFO *DirInfo, VOID *Data)
return (INT32) Status;
}

// Oh, and of course GRUB uses a 32 bit signed mtime value (seriously, wtf guys?!?)
if (DirInfo->MtimeSet)
GrubTimeToEfiTime(DirInfo->Mtime, &Time);
CopyMem(&Info->CreateTime, &Time, sizeof(Time));
Expand Down
6 changes: 3 additions & 3 deletions src/grub.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ static const unsigned short int __mon_yday[2][13] = {

/* Compute an EFI_TIME representation of a GRUB's mtime_t */
VOID
GrubTimeToEfiTime(const INT32 t, EFI_TIME *tp)
GrubTimeToEfiTime(const INT64 t, EFI_TIME *tp)
{
INT32 days, rem, y;
INT64 days, rem, y;
const unsigned short int *ip;

days = t / SECS_PER_DAY;
Expand All @@ -286,7 +286,7 @@ GrubTimeToEfiTime(const INT32 t, EFI_TIME *tp)

while (days < 0 || days >= (__isleap (y) ? 366 : 365)) {
/* Guess a corrected year, assuming 365 days per year. */
INT32 yg = y + days / 365 - (days % 365 < 0);
CONST INT64 yg = y + days / 365 - (days % 365 < 0);

/* Adjust DAYS and Y to match the guessed year. */
days -= ((yg - y) * 365
Expand Down
Loading