summaryrefslogtreecommitdiff
path: root/modutils/depmod.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2008-06-02 13:34:36 +0000
committerBernhard Reutner-Fischer2008-06-02 13:34:36 +0000
commitd42816763f2414117d01a950c0dc2ed4dd3146eb (patch)
treee4b86f265396a39923f359a57cdbc7d79af2a10a /modutils/depmod.c
parentbeac1bd58e231f8b1664c767dc128a1d86b27fff (diff)
downloadbusybox-d42816763f2414117d01a950c0dc2ed4dd3146eb.zip
busybox-d42816763f2414117d01a950c0dc2ed4dd3146eb.tar.gz
- just chdir to the basedir (-30b).
Diffstat (limited to 'modutils/depmod.c')
-rw-r--r--modutils/depmod.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/modutils/depmod.c b/modutils/depmod.c
index b0b09c2..b2bbc79 100644
--- a/modutils/depmod.c
+++ b/modutils/depmod.c
@@ -31,7 +31,6 @@ typedef struct dep_lst_t {
struct globals {
dep_lst_t *lst; /* modules without their corresponding extension */
- size_t moddir_base_len; /* length of the "-b basedir" */
};
#define G (*(struct globals*)&bb_common_bufsiz1)
/* We have to zero it out because of NOEXEC */
@@ -46,7 +45,7 @@ static int fill_lst(const char *modulename, struct stat ATTRIBUTE_UNUSED *sb,
*/
if (strrstr(modulename, ".ko") != NULL) {
dep_lst_t *new = xzalloc(sizeof(dep_lst_t));
- new->name = xstrdup(modulename + G.moddir_base_len);
+ new->name = xstrdup(modulename);
new->next = G.lst;
G.lst = new;
}
@@ -82,12 +81,12 @@ static int fileAction(const char *fname, struct stat *sb,
ptr = the_module;
this = G.lst;
do {
- if (!strcmp(fname + G.moddir_base_len, this->name))
+ if (!strcmp(fname, this->name))
break;
this = this->next;
} while (this);
dbg_assert (this);
-//bb_info_msg("fname='%s'", fname + G.moddir_base_len);
+//bb_info_msg("fname='%s'", fname);
do {
/* search for a 'd' */
ptr = memchr(ptr, 'd', len - (ptr - (char*)the_module));
@@ -157,13 +156,7 @@ int depmod_main(int ATTRIBUTE_UNUSED argc, char **argv)
option_mask32 |= *argv == NULL;
if (option_mask32 & ARG_b) {
- G.moddir_base_len = strlen(moddir_base);
- if (ENABLE_FEATURE_CLEAN_UP) {
- chp = moddir;
- moddir = concat_path_file(moddir_base, moddir);
- free (chp);
- } else
- moddir = concat_path_file(moddir_base, moddir);
+ xchdir(moddir_base);
}
if (!(option_mask32 & ARG_n)) { /* --dry-run */