diff options
author | Andrey Nazarov <skuller@skuller.net> | 2010-08-02 15:07:41 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2010-08-02 15:07:41 +0000 |
commit | 9bcc513cd43c78dee3c32446f353aaa0668c2180 (patch) | |
tree | 9617fbee93f86f629880ac300c8c1d283e7b3f36 /source/sys_win.c | |
parent | 5c73f165141b30d93309d25e1324bc0170eb4da5 (diff) |
Made client and server buildable with mingw32 again.
Use uint64_t type for network counters.
Diffstat (limited to 'source/sys_win.c')
-rw-r--r-- | source/sys_win.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/source/sys_win.c b/source/sys_win.c index 8a36bb5..329130a 100644 --- a/source/sys_win.c +++ b/source/sys_win.c @@ -808,11 +808,11 @@ static inline time_t file_time_to_unix( FILETIME *f ) { Sys_GetPathInfo ================ */ -qboolean Sys_GetPathInfo( const char *path, file_info_t *info ) { - WIN32_FILE_ATTRIBUTE_DATA data; +qerror_t Sys_GetPathInfo( const char *path, file_info_t *info ) { + WIN32_FILE_ATTRIBUTE_DATA data; if( !GetFileAttributesExA( path, GetFileExInfoStandard, &data ) ) { - return qfalse; + return Q_ERR_NOENT; // TODO: return proper error code } if( info ) { @@ -821,20 +821,23 @@ qboolean Sys_GetPathInfo( const char *path, file_info_t *info ) { info->mtime = file_time_to_unix( &data.ftLastWriteTime ); } - return qtrue; + return Q_ERR_SUCCESS; } -qboolean Sys_GetFileInfo( FILE *fp, file_info_t *info ) { - int pos; +qerror_t Sys_GetFileInfo( FILE *fp, file_info_t *info ) { + int pos, end; + // TODO: check for errors pos = ftell( fp ); fseek( fp, 0, SEEK_END ); - info->size = ftell( fp ); + end = ftell( fp ); + fseek( fp, pos, SEEK_SET ); + + info->size = end; info->ctime = 0; info->mtime = 0; - fseek( fp, pos, SEEK_SET ); - return qtrue; + return Q_ERR_SUCCESS; } |