diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-01-24 23:59:50 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-01-24 23:59:50 +0000 |
commit | 86f3d5bad6ec3280d247c0484f90ed78e35e32c3 (patch) | |
tree | f05c1c845b6a27d93e10761684f182024c046848 | |
parent | 54e9457920733c523f2983d106ca0f10ace05221 (diff) | |
download | busybox-w32-86f3d5bad6ec3280d247c0484f90ed78e35e32c3.tar.gz busybox-w32-86f3d5bad6ec3280d247c0484f90ed78e35e32c3.tar.bz2 busybox-w32-86f3d5bad6ec3280d247c0484f90ed78e35e32c3.zip |
Bug fix and small create_module cleanup from Larry Doolittle to
fix insmod, since I broke var=value args when I getopt'ified it.
-rw-r--r-- | insmod.c | 12 | ||||
-rw-r--r-- | modutils/insmod.c | 12 |
2 files changed, 12 insertions, 12 deletions
@@ -78,7 +78,7 @@ | |||
78 | #ifndef MODUTILS_MODULE_H | 78 | #ifndef MODUTILS_MODULE_H |
79 | static const int MODUTILS_MODULE_H = 1; | 79 | static const int MODUTILS_MODULE_H = 1; |
80 | 80 | ||
81 | #ident "$Id: insmod.c,v 1.38 2001/01/24 23:34:48 andersen Exp $" | 81 | #ident "$Id: insmod.c,v 1.39 2001/01/24 23:59:50 andersen Exp $" |
82 | 82 | ||
83 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 83 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
84 | We do not use the kernel headers directly because we do not wish | 84 | We do not use the kernel headers directly because we do not wish |
@@ -284,7 +284,7 @@ int delete_module(const char *); | |||
284 | #ifndef MODUTILS_OBJ_H | 284 | #ifndef MODUTILS_OBJ_H |
285 | static const int MODUTILS_OBJ_H = 1; | 285 | static const int MODUTILS_OBJ_H = 1; |
286 | 286 | ||
287 | #ident "$Id: insmod.c,v 1.38 2001/01/24 23:34:48 andersen Exp $" | 287 | #ident "$Id: insmod.c,v 1.39 2001/01/24 23:59:50 andersen Exp $" |
288 | 288 | ||
289 | /* The relocatable object is manipulated using elfin types. */ | 289 | /* The relocatable object is manipulated using elfin types. */ |
290 | 290 | ||
@@ -3039,6 +3039,9 @@ extern int insmod_main( int argc, char **argv) | |||
3039 | } | 3039 | } |
3040 | obj_allocate_commons(f); | 3040 | obj_allocate_commons(f); |
3041 | 3041 | ||
3042 | /* done with the module name, on to the optional var=value arguments */ | ||
3043 | ++optind; | ||
3044 | |||
3042 | if (optind < argc) { | 3045 | if (optind < argc) { |
3043 | if (m_has_modinfo | 3046 | if (m_has_modinfo |
3044 | ? !new_process_module_arguments(f, argc - optind, argv + optind) | 3047 | ? !new_process_module_arguments(f, argc - optind, argv + optind) |
@@ -3058,11 +3061,8 @@ extern int insmod_main( int argc, char **argv) | |||
3058 | m_size = obj_load_size(f); | 3061 | m_size = obj_load_size(f); |
3059 | 3062 | ||
3060 | 3063 | ||
3061 | errno = 0; | ||
3062 | m_addr = create_module(m_name, m_size); | 3064 | m_addr = create_module(m_name, m_size); |
3063 | switch (errno) { | 3065 | if (m_addr==-1) switch (errno) { |
3064 | case 0: | ||
3065 | break; | ||
3066 | case EEXIST: | 3066 | case EEXIST: |
3067 | error_msg("A module named %s already exists\n", m_name); | 3067 | error_msg("A module named %s already exists\n", m_name); |
3068 | goto out; | 3068 | goto out; |
diff --git a/modutils/insmod.c b/modutils/insmod.c index e52da91e4..fc49dcd34 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -78,7 +78,7 @@ | |||
78 | #ifndef MODUTILS_MODULE_H | 78 | #ifndef MODUTILS_MODULE_H |
79 | static const int MODUTILS_MODULE_H = 1; | 79 | static const int MODUTILS_MODULE_H = 1; |
80 | 80 | ||
81 | #ident "$Id: insmod.c,v 1.38 2001/01/24 23:34:48 andersen Exp $" | 81 | #ident "$Id: insmod.c,v 1.39 2001/01/24 23:59:50 andersen Exp $" |
82 | 82 | ||
83 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 83 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
84 | We do not use the kernel headers directly because we do not wish | 84 | We do not use the kernel headers directly because we do not wish |
@@ -284,7 +284,7 @@ int delete_module(const char *); | |||
284 | #ifndef MODUTILS_OBJ_H | 284 | #ifndef MODUTILS_OBJ_H |
285 | static const int MODUTILS_OBJ_H = 1; | 285 | static const int MODUTILS_OBJ_H = 1; |
286 | 286 | ||
287 | #ident "$Id: insmod.c,v 1.38 2001/01/24 23:34:48 andersen Exp $" | 287 | #ident "$Id: insmod.c,v 1.39 2001/01/24 23:59:50 andersen Exp $" |
288 | 288 | ||
289 | /* The relocatable object is manipulated using elfin types. */ | 289 | /* The relocatable object is manipulated using elfin types. */ |
290 | 290 | ||
@@ -3039,6 +3039,9 @@ extern int insmod_main( int argc, char **argv) | |||
3039 | } | 3039 | } |
3040 | obj_allocate_commons(f); | 3040 | obj_allocate_commons(f); |
3041 | 3041 | ||
3042 | /* done with the module name, on to the optional var=value arguments */ | ||
3043 | ++optind; | ||
3044 | |||
3042 | if (optind < argc) { | 3045 | if (optind < argc) { |
3043 | if (m_has_modinfo | 3046 | if (m_has_modinfo |
3044 | ? !new_process_module_arguments(f, argc - optind, argv + optind) | 3047 | ? !new_process_module_arguments(f, argc - optind, argv + optind) |
@@ -3058,11 +3061,8 @@ extern int insmod_main( int argc, char **argv) | |||
3058 | m_size = obj_load_size(f); | 3061 | m_size = obj_load_size(f); |
3059 | 3062 | ||
3060 | 3063 | ||
3061 | errno = 0; | ||
3062 | m_addr = create_module(m_name, m_size); | 3064 | m_addr = create_module(m_name, m_size); |
3063 | switch (errno) { | 3065 | if (m_addr==-1) switch (errno) { |
3064 | case 0: | ||
3065 | break; | ||
3066 | case EEXIST: | 3066 | case EEXIST: |
3067 | error_msg("A module named %s already exists\n", m_name); | 3067 | error_msg("A module named %s already exists\n", m_name); |
3068 | goto out; | 3068 | goto out; |