diff options
author | Guy Harris <guy@alum.mit.edu> | 2010-04-01 00:27:25 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2010-04-01 00:27:25 +0000 |
commit | 7b41a728018b57e88b189a0998a613d61dd6d44d (patch) | |
tree | 079ae5acc25c369212ba40da2d8bcfafa5bfc2be /dumpcap.c | |
parent | d87005b114a631daefcb9039fb8cd14432551b4e (diff) | |
download | wireshark-7b41a728018b57e88b189a0998a613d61dd6d44d.tar.gz wireshark-7b41a728018b57e88b189a0998a613d61dd6d44d.tar.bz2 wireshark-7b41a728018b57e88b189a0998a613d61dd6d44d.zip |
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
Diffstat (limited to 'dumpcap.c')
-rw-r--r-- | dumpcap.c | 26 |
1 files changed, 18 insertions, 8 deletions
@@ -266,7 +266,7 @@ static loop_data global_ld; * fixed in 10.6.2. */ #if defined(__APPLE__) && defined(__LP64__) -static int need_timeout_workaround; +static gboolean need_timeout_workaround; #define CAP_READ_TIMEOUT (need_timeout_workaround ? 1000 : 250) #else @@ -2721,18 +2721,28 @@ main(int argc, char *argv[]) #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) { /* - * Mac OS X 10.x uses Darwin x.0.0. Mac OS X 10.x.y uses Darwin - * x.y.0 (except that 10.6.1 appears to have a uname version + * Mac OS X 10.x uses Darwin {x+4}.0.0. Mac OS X 10.x.y uses Darwin + * {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). */ - if (strcmp(osinfo.release, "10.0.0") == 0 || - strcmp(osinfo.release, "10.1.0") == 0 || - strcmp(osinfo.release, "10.3.0") == 0) - need_timeout_workaround = 1; + if (strncmp(osinfo.release, "10.", 3) == 0) { + /* + * OK, it's Snow Leopard - which version? + */ + if (strcmp(osinfo.release, "10.2.0") != 0) { + /* Not 10.6.2. */ + need_timeout_workaround = TRUE; + } + } } #endif |