Expand the comment explaining the workaround for the Snow Leopard
timeout bug. Make the code for the workaround assume any 10.6.x release other than 10.6.2 requires it; that way we don't have to update the code until either 1) Apple fixes the bug in a later 10.6.x update or 2) Apple comes out with a major release that still has, or reintroduces, the bug. svn path=/trunk/; revision=32349
This commit is contained in:
parent
d87005b114
commit
7b41a72801
26
dumpcap.c
26
dumpcap.c
|
@ -266,7 +266,7 @@ static loop_data global_ld;
|
||||||
* fixed in 10.6.2.
|
* fixed in 10.6.2.
|
||||||
*/
|
*/
|
||||||
#if defined(__APPLE__) && defined(__LP64__)
|
#if defined(__APPLE__) && defined(__LP64__)
|
||||||
static int need_timeout_workaround;
|
static gboolean need_timeout_workaround;
|
||||||
|
|
||||||
#define CAP_READ_TIMEOUT (need_timeout_workaround ? 1000 : 250)
|
#define CAP_READ_TIMEOUT (need_timeout_workaround ? 1000 : 250)
|
||||||
#else
|
#else
|
||||||
|
@ -2721,18 +2721,28 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
#if defined(__APPLE__) && defined(__LP64__)
|
#if defined(__APPLE__) && defined(__LP64__)
|
||||||
/*
|
/*
|
||||||
* Is this Mac OS X 10.6 or 10.6.1? If so, we need a bug workaround.
|
* Is this Mac OS X 10.6.x, other than 10.6.2? If so, we need a bug
|
||||||
|
* workaround - timeouts less than 1 second don't work with libpcap
|
||||||
|
* in 64-bit code. (The bug was introduced in 10.6, fixed in 10.6.2,
|
||||||
|
* and re-introduced in 10.6.3. We don't know whether it'll be fixed
|
||||||
|
* again in a later 10.6.x release; we'll assume that it'll be fixed
|
||||||
|
* in any future major releases.)
|
||||||
*/
|
*/
|
||||||
if (uname(&osinfo) == 0) {
|
if (uname(&osinfo) == 0) {
|
||||||
/*
|
/*
|
||||||
* Mac OS X 10.x uses Darwin x.0.0. Mac OS X 10.x.y uses Darwin
|
* Mac OS X 10.x uses Darwin {x+4}.0.0. Mac OS X 10.x.y uses Darwin
|
||||||
* x.y.0 (except that 10.6.1 appears to have a uname version
|
* {x+4}.y.0 (except that 10.6.1 appears to have a uname version
|
||||||
* number of 10.0.0, not 10.1.0 - go figure).
|
* number of 10.0.0, not 10.1.0 - go figure).
|
||||||
*/
|
*/
|
||||||
if (strcmp(osinfo.release, "10.0.0") == 0 ||
|
if (strncmp(osinfo.release, "10.", 3) == 0) {
|
||||||
strcmp(osinfo.release, "10.1.0") == 0 ||
|
/*
|
||||||
strcmp(osinfo.release, "10.3.0") == 0)
|
* OK, it's Snow Leopard - which version?
|
||||||
need_timeout_workaround = 1;
|
*/
|
||||||
|
if (strcmp(osinfo.release, "10.2.0") != 0) {
|
||||||
|
/* Not 10.6.2. */
|
||||||
|
need_timeout_workaround = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue