diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-11-27 19:01:53 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-11-27 19:01:53 +0000 |
commit | 481e1175688ab1f22e8778e402c9485df8a761fc (patch) | |
tree | dc24d99f04dc20e7304bf75d6f2bc6838c610e5f /modutils | |
parent | 803633d5052f8ff23ec95dbb76e3da6a7bbbcfe7 (diff) | |
download | busybox-w32-481e1175688ab1f22e8778e402c9485df8a761fc.tar.gz busybox-w32-481e1175688ab1f22e8778e402c9485df8a761fc.tar.bz2 busybox-w32-481e1175688ab1f22e8778e402c9485df8a761fc.zip |
Patch from Cristian Ionescu-Idbohrn to deal with _ vs - better.
git-svn-id: svn://busybox.net/trunk/busybox@12546 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'modutils')
-rw-r--r-- | modutils/rmmod.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modutils/rmmod.c b/modutils/rmmod.c index f4e65d0ce..512221ba5 100644 --- a/modutils/rmmod.c +++ b/modutils/rmmod.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <getopt.h> | 27 | #include <getopt.h> |
28 | #include <fcntl.h> | 28 | #include <fcntl.h> |
29 | #include <string.h> | 29 | #include <string.h> |
30 | #include <sys/utsname.h> | ||
30 | #include <sys/syscall.h> | 31 | #include <sys/syscall.h> |
31 | #include "busybox.h" | 32 | #include "busybox.h" |
32 | 33 | ||
@@ -44,7 +45,16 @@ static inline void filename2modname(char *modname, const char *filename) | |||
44 | 45 | ||
45 | /* Convert to underscores, stop at first . */ | 46 | /* Convert to underscores, stop at first . */ |
46 | for (i = 0; afterslash[i] && afterslash[i] != '.'; i++) { | 47 | for (i = 0; afterslash[i] && afterslash[i] != '.'; i++) { |
47 | if (afterslash[i] == '-') | 48 | int kr_chk = 1; |
49 | |||
50 | if (ENABLE_FEATURE_2_4_MODULES) { | ||
51 | struct utsname uname_info; | ||
52 | if (uname(&uname_info) == -1) | ||
53 | bb_error_msg_and_die("cannot get uname data"); | ||
54 | if (strcmp(uname_info.release, "2.6") < 0) | ||
55 | kr_chk = 0; | ||
56 | } | ||
57 | if (kr_chk && (afterslash[i] == '-')) | ||
48 | modname[i] = '_'; | 58 | modname[i] = '_'; |
49 | else | 59 | else |
50 | modname[i] = afterslash[i]; | 60 | modname[i] = afterslash[i]; |