Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

also check errno when lseek64 returns -1 #117

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading