Skip to content

Commit

Permalink
Merge pull request #117 from karas84/master
Browse files Browse the repository at this point in the history
also check errno when lseek64 returns -1
  • Loading branch information
AKuHAK authored Oct 3, 2023
2 parents 073dd41 + a498ab5 commit 0a554e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static void saveSkinBrowser(void)
char *preloadCNF(char *path)
{
int fd, tst;
size_t CNF_size;
s64 CNF_size;
char cnf_path[MAX_PATH];
char *RAM_p;

Expand All @@ -292,7 +292,7 @@ char *preloadCNF(char *path)
return NULL;
}
CNF_size = genLseek(fd, 0, SEEK_END);
printf("CNF_size=%lu\n", (unsigned long)CNF_size);
printf("CNF_size=%lld\n", CNF_size);
genLseek(fd, 0, SEEK_SET);
RAM_p = (char *)memalign(64, CNF_size);
if (RAM_p == NULL) {
Expand Down
3 changes: 2 additions & 1 deletion filer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// File name: filer.c
//--------------------------------------------------------------
#include "launchelf.h"
#include <errno.h>

typedef struct
{
Expand Down Expand Up @@ -1008,7 +1009,7 @@ int genDopen(char *path)
s64 genLseek(int fd, s64 where, int how)
{
s64 res = lseek64(fd, where, how);
if (res == -48) {
if (res == -48 || (res == -1 && errno == 48)) {
res = lseek(fd, where, how);
}
return res;
Expand Down

0 comments on commit 0a554e8

Please sign in to comment.