[libcdio] _stat() does not work with files > 4GB - must use _stat64

* move internal stream sizes to 64 bit as a result
* see http://msdn.microsoft.com/en-us/library/14h5k7ff.aspx
This commit is contained in:
Pete Batard 2012-01-16 23:57:01 +00:00
parent 26a131e5f0
commit fcc2486867
4 changed files with 13 additions and 13 deletions

View File

@ -50,7 +50,7 @@ typedef struct {
char *pathname;
FILE *fd;
char *fd_buf;
off_t st_size; /* used only for source */
int64_t st_size; /* used only for source */
} _UserData;
static int
@ -125,7 +125,7 @@ _stdio_seek(void *p_user_data, long i_offset, int whence)
return i_offset;
}
static long int
static uint64_t
_stdio_stat(void *p_user_data)
{
const _UserData *const ud = p_user_data;
@ -192,9 +192,9 @@ cdio_stdio_new(const char pathname[])
CdioDataSource_t *new_obj = NULL;
cdio_stream_io_functions funcs = { NULL, NULL, NULL, NULL, NULL, NULL };
_UserData *ud = NULL;
struct _stat statbuf;
struct _stat64 statbuf;
if (_stat (pathname, &statbuf) == -1)
if (_stat64 (pathname, &statbuf) == -1)
{
cdio_warn ("could not retrieve file info for `%s': %s",
pathname, strerror (errno));

View File

@ -204,7 +204,7 @@ cdio_stream_seek(CdioDataSource_t* p_obj, ssize_t offset, int whence)
Return whatever size of stream reports, I guess unit size is bytes.
On error return -1;
*/
ssize_t
int64_t
cdio_stream_stat(CdioDataSource_t *p_obj)
{
if (!p_obj) return -1;

View File

@ -38,7 +38,7 @@ extern "C" {
typedef driver_return_code_t(*cdio_data_seek_t)(void *user_data, long offset,
int whence);
typedef long(*cdio_data_stat_t)(void *user_data);
typedef uint64_t(*cdio_data_stat_t)(void *user_data);
typedef int(*cdio_data_close_t)(void *user_data);
@ -114,7 +114,7 @@ extern "C" {
Return whatever size of stream reports, I guess unit size is bytes.
On error return -1;
*/
ssize_t cdio_stream_stat(CdioDataSource_t *p_obj);
int64_t cdio_stream_stat(CdioDataSource_t *p_obj);
/**
Deallocate resources associated with p_obj. After this p_obj is unusable.

View File

@ -33,7 +33,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 278
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Rufus v1.0.7.134"
CAPTION "Rufus v1.0.7.135"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,236,50,14
@ -70,7 +70,7 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP
CONTROL "<a href=""http://rufus.akeo.ie"">http://rufus.akeo.ie</a>",IDC_ABOUT_RUFUS_URL,
"SysLink",WS_TABSTOP,46,47,114,9
LTEXT "Version 1.0.7 (Build 134)",IDC_STATIC,46,19,78,8
LTEXT "Version 1.0.7 (Build 135)",IDC_STATIC,46,19,78,8
PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP
EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL
LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8
@ -208,8 +208,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,7,134
PRODUCTVERSION 1,0,7,134
FILEVERSION 1,0,7,135
PRODUCTVERSION 1,0,7,135
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -226,13 +226,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.0.7.134"
VALUE "FileVersion", "1.0.7.135"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.0.7.134"
VALUE "ProductVersion", "1.0.7.135"
END
END
BLOCK "VarFileInfo"