chore: autotest windows & linux on PR + remove 2 warnings under Linux

This commit is contained in:
Stéphane Lesimple
2020-08-29 21:44:15 +02:00
committed by GitHub
parent 49eecc0a6f
commit 3eecbcbdcc
3 changed files with 83 additions and 9 deletions

View File

@@ -40,8 +40,8 @@
#include <windows.h>
#define stat _stati64
#define lseek _lseeki64
#define large_stat _stati64
#define large_lseek _lseeki64
/* The original windows ftruncate has off_size (32bit) */
@@ -62,6 +62,8 @@ int large_ftruncate(int fd, gint64 size)
#else
#define large_ftruncate ftruncate
#define large_stat stat
#define large_lseek lseek
#endif /* SYS_MINGW */
/*
@@ -90,7 +92,7 @@ int LargeStat(char *path, guint64 *length_return)
if(!cp_path) return FALSE;
if(stat(cp_path, &mystat) == -1)
if(large_stat(cp_path, &mystat) == -1)
{ g_free(cp_path);
return FALSE;
}
@@ -113,7 +115,7 @@ int DirStat(char *path)
if(!cp_path) return FALSE;
if(stat(cp_path, &mystat) == -1)
if(large_stat(cp_path, &mystat) == -1)
{ g_free(cp_path);
return FALSE;
}
@@ -148,7 +150,7 @@ LargeFile* LargeOpen(char *name, int flags, mode_t mode)
/* Do not try to open directories etc. */
if( (stat(cp_path, &mystat) == 0)
if( (large_stat(cp_path, &mystat) == 0)
&& !S_ISREG(mystat.st_mode))
{ g_free(cp_path), g_free(lf); return NULL;
}
@@ -175,7 +177,7 @@ LargeFile* LargeOpen(char *name, int flags, mode_t mode)
int LargeSeek(LargeFile *lf, off_t pos)
{
lf->offset = pos;
if(lseek(lf->fileHandle, pos, SEEK_SET) != pos)
if(large_lseek(lf->fileHandle, pos, SEEK_SET) != pos)
return FALSE;
return TRUE;