lkml.org 
[lkml]   [2002]   [Dec]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From"Zhuang, Louis" <>
Subject[PATCH] fix os release detection in module-init-tools-0.9.6
DateSat, 28 Dec 2002 13:49:49 +0800
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/
\
 
 \ /
  Last update: 2005-03-22 12:31    [from the cache]
©2003-2008