aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1999-01-31 00:19:45 +0000
committerEric S. Raymond <esr@thyrsus.com>1999-01-31 00:19:45 +0000
commit2536f3bbf0c7d5fc3ef14a21c11e07efea6cf294 (patch)
tree3f86d382fdd1589334dbfd68b74b870d932906ca
parentfb97c4e25a3fc602c050d8e0b52b84d6b01ebefc (diff)
downloadfetchmail-2536f3bbf0c7d5fc3ef14a21c11e07efea6cf294.tar.gz
fetchmail-2536f3bbf0c7d5fc3ef14a21c11e07efea6cf294.tar.bz2
fetchmail-2536f3bbf0c7d5fc3ef14a21c11e07efea6cf294.zip
Autoconfigure detection of whether we have 2.2.
svn path=/trunk/; revision=2358
-rw-r--r--acconfig.h3
-rw-r--r--configure.in11
-rw-r--r--interface.c2
3 files changed, 15 insertions, 1 deletions
diff --git a/acconfig.h b/acconfig.h
index d0f1c611..2f22e699 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -112,6 +112,9 @@
/* Define if you want built-in SOCKS support */
#undef HAVE_SOCKS
+/* Define if it looks like we have new /proc/dev/net format under Linux */
+#undef HAVE_NEWPROCNETDEV
+
/* Define to the version of the distribution. */
#undef VERSION
diff --git a/configure.in b/configure.in
index 56098371..d637ddd1 100644
--- a/configure.in
+++ b/configure.in
@@ -183,6 +183,17 @@ AC_TRY_LINK([#include <signal.h>
[AC_DEFINE(SYS_SIGLIST_DECLARED) AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
+dnl Figure out whether we're using a 2.2 kernel (assuming this is Linux)
+AC_MSG_CHECKING(OS kernel major version)
+set -- `uname -r | tr '.' ' '`
+release="${1}.${2}"
+AC_MSG_RESULT($release)
+if expr "$release" '>=' '2.2' >/dev/null
+then
+ AC_DEFINE(HAVE_NEWPROCNETDEV)
+ AC_MSG_RESULT("assuming new /proc/dev/net format")
+fi
+
# Find the right directory to put the root-mode PID file in
for dir in "/var/run" "/etc"
do
diff --git a/interface.c b/interface.c
index 9c01a0e9..05d34404 100644
--- a/interface.c
+++ b/interface.c
@@ -41,7 +41,7 @@ struct interface_pair_s {
struct in_addr interface_mask;
} *interface_pair;
-#ifdef linux22
+#ifdef HAVE_NEWPROCNETDEV
/* Linux 2.2 /proc/net/dev format -- transmit packet count in 10th field */
#define PROCNETDEV "%d %d %*d %*d %*d %d %*d %*d %*d %*d %d %*d %d"
#else