From: risso Date: Fri, 8 Aug 2003 09:47:45 +0000 (+0000) Subject: Cleanup of the Windows portion. The result of the GetVersion() function, that obtains... X-Git-Tag: tcpdump-3.8-bp~60 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/af44e60e4e7d7a6bd71cab9bd64b9245a5d39949?hp=4febff5a4f58e103f0e9f54dc87dba6238bea21e Cleanup of the Windows portion. The result of the GetVersion() function, that obtains the Windows OS version, was never used: avoid to call it. Removed the call to PrinCapBegins in w32_fzs.c. --- diff --git a/tcpdump.c b/tcpdump.c index b4ea020c..ce32be5e 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -30,7 +30,7 @@ static const char copyright[] = "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\ The Regents of the University of California. All rights reserved.\n"; static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.213 2003-08-06 06:49:41 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.214 2003-08-08 09:47:45 risso Exp $ (LBL)"; #endif /* @@ -317,15 +317,8 @@ main(int argc, char **argv) int devnum; #endif #ifdef WIN32 - DWORD dwVersion; - DWORD dwWindowsMajorVersion; - u_int UserBufferSize=1000000; -#endif - -#ifdef WIN32 - dwVersion=GetVersion(); /* get the OS version */ - dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); - if(wsockinit()!=0) return 1; + u_int UserBufferSize = 1000000; + if(wsockinit() != 0) return 1; #endif /* WIN32 */ cnt = -1; @@ -641,7 +634,19 @@ main(int argc, char **argv) error("%s", ebuf); } #ifdef WIN32 - PrintCapBegins(program_name,device); + if(IsTextUnicode(device, + wcslen((short*)device), // Device always ends with a double \0, so this way to determine its + // length should be always valid + NULL)) + { + fprintf(stderr, "%s: listening on %ws\n", program_name, device); + } + else + { + fprintf(stderr, "%s: listening on %s\n", program_name, device); + } + + fflush(stderr); #endif /* WIN32 */ *ebuf = '\0'; pd = pcap_open_live(device, snaplen, !pflag, 1000, ebuf);