diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-04-10 20:59:10 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-04-10 20:59:10 +0000 |
commit | 4fdcc5c18044f7af0e4d892819e202090199bc4b (patch) | |
tree | d13512b25cf373d606ea059eae4f836085f3a99e /wsutil | |
parent | f2008e4dd388076f50caa024d1900afa2116b7b9 (diff) | |
download | wireshark-4fdcc5c18044f7af0e4d892819e202090199bc4b.tar.gz wireshark-4fdcc5c18044f7af0e4d892819e202090199bc4b.tar.bz2 wireshark-4fdcc5c18044f7af0e4d892819e202090199bc4b.zip |
Rename ws_stat to ws_stat64, and make it take a pointer to a ws_statb64
as an argument, along the lines of ws_fstat64, and, on Windows, make it
use _wstati64, to handle 64-bit file sizes.
svn path=/trunk/; revision=36547
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/file_util.c | 6 | ||||
-rw-r--r-- | wsutil/file_util.h | 18 |
2 files changed, 13 insertions, 11 deletions
diff --git a/wsutil/file_util.c b/wsutil/file_util.c index c9bb0dc647..47b8deff1a 100644 --- a/wsutil/file_util.c +++ b/wsutil/file_util.c @@ -222,8 +222,8 @@ ws_stdio_mkdir (const gchar *filename, * Since: 2.6 */ int -ws_stdio_stat (const gchar *filename, - struct stat *buf) +ws_stdio_stat64 (const gchar *filename, + ws_statb64 *buf) { wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL); int retval; @@ -243,7 +243,7 @@ ws_stdio_stat (const gchar *filename, (!g_path_is_absolute (filename) || len > (size_t) (g_path_skip_root (filename) - filename))) wfilename[len] = '\0'; - retval = _wstat (wfilename, (struct _stat *) buf); + retval = _wstati64 (wfilename, buf); save_errno = errno; g_free (wfilename); diff --git a/wsutil/file_util.h b/wsutil/file_util.h index 65164165c3..d31746498f 100644 --- a/wsutil/file_util.h +++ b/wsutil/file_util.h @@ -60,7 +60,7 @@ extern FILE * ws_stdio_freopen (const gchar *filename, const gchar *mode, FILE * #define ws_open ws_stdio_open #define ws_rename ws_stdio_rename #define ws_mkdir ws_stdio_mkdir -#define ws_stat ws_stdio_stat +#define ws_stat64 ws_stdio_stat64 #define ws_unlink ws_stdio_unlink #define ws_remove ws_stdio_remove #define ws_fopen ws_stdio_fopen @@ -70,14 +70,16 @@ extern FILE * ws_stdio_freopen (const gchar *filename, const gchar *mode, FILE * /* "Not Windows" or GLib < 2.6: use "old school" functions */ #ifdef _WIN32 -#define ws_open _open -#define ws_stat _stat -#define ws_unlink _unlink +/* Windows, but GLib < 2.6 */ +#define ws_open _open +#define ws_stat64 _stati64 /* use _stati64 for 64-bit size support */ +#define ws_unlink _unlink #define ws_mkdir(dir,mode) _mkdir(dir) -#else -#define ws_open open -#define ws_stat stat -#define ws_unlink unlink +#else /* _WIN32 */ +/* "Not Windows" */ +#define ws_open open +#define ws_stat64 stat +#define ws_unlink unlink #define ws_mkdir(dir,mode) mkdir(dir,mode) #endif /* _WIN32 */ |