[PATCH] fix os release detection in module-init-tools-0.9.6

From: Zhuang, Louis (louis.zhuang@intel.com)
Date: Sat Dec 28 2002 - 00:49:49 EST


Dear Rusty,
        IMHO, try_old_version can tell kernel release better with this
patch, don't you? ;->
  - Louis

diff -Nur module-init-tools-0.9.6/backwards_compat.c
module-init-tools-0.9.6-lz1/backwards_compat.c
--- module-init-tools-0.9.6/backwards_compat.c 2002-12-21
12:31:11.000000000 +0800
+++ module-init-tools-0.9.6-lz1/backwards_compat.c 2002-12-28
13:29:50.000000000 +0800
@@ -4,6 +4,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/utsname.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <errno.h>
@@ -59,10 +60,14 @@
 static void try_old_version(const char *progname, char *argv[])
 {
         struct stat buf;
- /* 2.2 and 2.4 have a syscall. 2.0 doesn't, but does have
- /proc/ksyms */
+ struct utsname un;
+
+ uname(&un);
+
+ /* 2.2 and 2.4 have a syscall. 2.0 doesn't, so we compare
+ release */
         if (query_module(NULL, 0, NULL, 0, NULL) == 0
- || stat("/proc/ksyms", &buf) == 0)
+ || strncmp("2.0", un.release, 3) == 0)
                 exec_old(progname, argv);
 }
 #else /* CONFIG_NO_BACKWARDS_COMPAT */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Dec 31 2002 - 22:00:11 EST