From 0492921adc1d6e3978b93bcac35140510228a62a Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Fri, 25 Jul 2014 13:50:00 +0200 Subject: Replace lseek/fstat by ws_lseek64/ws_fstat64 lseek returns an off_t type which is system-dependent. Use ws_lseek64 in favor of lseek as that supports 64-bit quanities. Use ws_fstat64 instead of stat to support 64-bit file sizes on Windows. For the majority of the changes, this makes no difference as they do not apply to Windows ("ifndef _WIN32"; availability of st_blksize). There are no other users of "struct stat" besides the portability code in wsutil. Forbid the use of fstat and lseek in checkAPIs. Change-Id: I17b930ab9543f21a9d3100f3795d250c9b9ae459 Reviewed-on: https://code.wireshark.org/review/3198 Reviewed-by: Guy Harris --- tfshark.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tfshark.c') diff --git a/tfshark.c b/tfshark.c index e67dbd1c0c..008cafa376 100644 --- a/tfshark.c +++ b/tfshark.c @@ -1960,9 +1960,9 @@ load_cap_file(capture_file *cf, int max_packet_count, gint64 max_byte_count) */ #ifndef _WIN32 if (print_packet_info) { - struct stat stat_stdout, stat_stderr; + ws_statb64 stat_stdout, stat_stderr; - if (fstat(1, &stat_stdout) == 0 && fstat(2, &stat_stderr) == 0) { + if (ws_fstat64(1, &stat_stdout) == 0 && ws_fstat64(2, &stat_stderr) == 0) { if (stat_stdout.st_dev == stat_stderr.st_dev && stat_stdout.st_ino == stat_stderr.st_ino) { fflush(stdout); -- cgit v1.2.3