diff options
| author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-06-03 19:35:15 +0000 |
|---|---|---|
| committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-06-03 19:35:15 +0000 |
| commit | deda6a5c0d00d02813cfda0d6262a24462909e9f (patch) | |
| tree | cd2151ee74f7350abcbe692f8115e91547e08e15 /modutils | |
| parent | 2c351a8f9875a4b597641bc4c0da76db485fe184 (diff) | |
| download | busybox-w32-deda6a5c0d00d02813cfda0d6262a24462909e9f.tar.gz busybox-w32-deda6a5c0d00d02813cfda0d6262a24462909e9f.tar.bz2 busybox-w32-deda6a5c0d00d02813cfda0d6262a24462909e9f.zip | |
- move #include busybox.h to the very top so we pull in the config
and eventual platform specific includes in early.
- remove two supposedly superfluous newlines from ...error_msg() in modprobe
and use shorter boilerplate while at it.
Diffstat (limited to 'modutils')
| -rw-r--r-- | modutils/insmod.c | 4 | ||||
| -rw-r--r-- | modutils/lsmod.c | 17 | ||||
| -rw-r--r-- | modutils/modprobe.c | 6 | ||||
| -rw-r--r-- | modutils/rmmod.c | 17 |
4 files changed, 9 insertions, 35 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c index f38daa257..f8464dbd1 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
| @@ -58,6 +58,7 @@ | |||
| 58 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 58 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
| 59 | */ | 59 | */ |
| 60 | 60 | ||
| 61 | #include "busybox.h" | ||
| 61 | #include <stdlib.h> | 62 | #include <stdlib.h> |
| 62 | #include <stdio.h> | 63 | #include <stdio.h> |
| 63 | #include <stddef.h> | 64 | #include <stddef.h> |
| @@ -70,7 +71,6 @@ | |||
| 70 | #include <getopt.h> | 71 | #include <getopt.h> |
| 71 | #include <fcntl.h> | 72 | #include <fcntl.h> |
| 72 | #include <sys/utsname.h> | 73 | #include <sys/utsname.h> |
| 73 | #include "busybox.h" | ||
| 74 | 74 | ||
| 75 | #if !defined(CONFIG_FEATURE_2_4_MODULES) && \ | 75 | #if !defined(CONFIG_FEATURE_2_4_MODULES) && \ |
| 76 | !defined(CONFIG_FEATURE_2_6_MODULES) | 76 | !defined(CONFIG_FEATURE_2_6_MODULES) |
| @@ -3313,7 +3313,7 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits) | |||
| 3313 | } | 3313 | } |
| 3314 | if (f->header.e_ident[EI_CLASS] != ELFCLASSM | 3314 | if (f->header.e_ident[EI_CLASS] != ELFCLASSM |
| 3315 | || f->header.e_ident[EI_DATA] != (BB_BIG_ENDIAN | 3315 | || f->header.e_ident[EI_DATA] != (BB_BIG_ENDIAN |
| 3316 | ? ELFDATA2MSB : ELFDATA2LSB) | 3316 | ? ELFDATA2MSB : ELFDATA2LSB) |
| 3317 | || f->header.e_ident[EI_VERSION] != EV_CURRENT | 3317 | || f->header.e_ident[EI_VERSION] != EV_CURRENT |
| 3318 | || !MATCH_MACHINE(f->header.e_machine)) { | 3318 | || !MATCH_MACHINE(f->header.e_machine)) { |
| 3319 | bb_error_msg("ELF file not for this architecture"); | 3319 | bb_error_msg("ELF file not for this architecture"); |
diff --git a/modutils/lsmod.c b/modutils/lsmod.c index 3bbf89e58..10af2bd0d 100644 --- a/modutils/lsmod.c +++ b/modutils/lsmod.c | |||
| @@ -8,22 +8,10 @@ | |||
| 8 | * Nicolas Ferre <nicolas.ferre@alcove.fr> to support pre 2.1 kernels | 8 | * Nicolas Ferre <nicolas.ferre@alcove.fr> to support pre 2.1 kernels |
| 9 | * (which lack the query_module() interface). | 9 | * (which lack the query_module() interface). |
| 10 | * | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify | 11 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
| 12 | * it under the terms of the GNU General Public License as published by | ||
| 13 | * the Free Software Foundation; either version 2 of the License, or | ||
| 14 | * (at your option) any later version. | ||
| 15 | * | ||
| 16 | * This program is distributed in the hope that it will be useful, | ||
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 19 | * General Public License for more details. | ||
| 20 | * | ||
| 21 | * You should have received a copy of the GNU General Public License | ||
| 22 | * along with this program; if not, write to the Free Software | ||
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 24 | * | ||
| 25 | */ | 12 | */ |
| 26 | 13 | ||
| 14 | #include "busybox.h" | ||
| 27 | #include <stdlib.h> | 15 | #include <stdlib.h> |
| 28 | #include <stdio.h> | 16 | #include <stdio.h> |
| 29 | #include <string.h> | 17 | #include <string.h> |
| @@ -36,7 +24,6 @@ | |||
| 36 | #include <getopt.h> | 24 | #include <getopt.h> |
| 37 | #include <sys/utsname.h> | 25 | #include <sys/utsname.h> |
| 38 | #include <sys/file.h> | 26 | #include <sys/file.h> |
| 39 | #include "busybox.h" | ||
| 40 | 27 | ||
| 41 | 28 | ||
| 42 | #ifndef CONFIG_FEATURE_CHECK_TAINTED_MODULE | 29 | #ifndef CONFIG_FEATURE_CHECK_TAINTED_MODULE |
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 44460391a..93e510293 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 11 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #include "busybox.h" | ||
| 14 | #include <sys/utsname.h> | 15 | #include <sys/utsname.h> |
| 15 | #include <sys/types.h> | 16 | #include <sys/types.h> |
| 16 | #include <sys/wait.h> | 17 | #include <sys/wait.h> |
| @@ -22,7 +23,6 @@ | |||
| 22 | #include <ctype.h> | 23 | #include <ctype.h> |
| 23 | #include <fcntl.h> | 24 | #include <fcntl.h> |
| 24 | #include <fnmatch.h> | 25 | #include <fnmatch.h> |
| 25 | #include "busybox.h" | ||
| 26 | 26 | ||
| 27 | struct mod_opt_t { /* one-way list of options to pass to a module */ | 27 | struct mod_opt_t { /* one-way list of options to pass to a module */ |
| 28 | char * m_opt_val; | 28 | char * m_opt_val; |
| @@ -880,7 +880,7 @@ int modprobe_main(int argc, char** argv) | |||
| 880 | depend = build_dep ( ); | 880 | depend = build_dep ( ); |
| 881 | 881 | ||
| 882 | if ( !depend ) | 882 | if ( !depend ) |
| 883 | bb_error_msg_and_die ( "could not parse modules.dep\n" ); | 883 | bb_error_msg_and_die ( "could not parse modules.dep" ); |
| 884 | 884 | ||
| 885 | if (remove_opt) { | 885 | if (remove_opt) { |
| 886 | do { | 886 | do { |
| @@ -893,7 +893,7 @@ int modprobe_main(int argc, char** argv) | |||
| 893 | } while ( ++optind < argc ); | 893 | } while ( ++optind < argc ); |
| 894 | } else { | 894 | } else { |
| 895 | if (optind >= argc) | 895 | if (optind >= argc) |
| 896 | bb_error_msg_and_die ( "No module or pattern provided\n" ); | 896 | bb_error_msg_and_die ( "No module or pattern provided" ); |
| 897 | 897 | ||
| 898 | if ( mod_insert ( argv [optind], argc - optind - 1, argv + optind + 1 )) | 898 | if ( mod_insert ( argv [optind], argc - optind - 1, argv + optind + 1 )) |
| 899 | bb_error_msg_and_die ( "failed to load module %s", argv [optind] ); | 899 | bb_error_msg_and_die ( "failed to load module %s", argv [optind] ); |
diff --git a/modutils/rmmod.c b/modutils/rmmod.c index 36bea3486..97650a4b2 100644 --- a/modutils/rmmod.c +++ b/modutils/rmmod.c | |||
| @@ -4,22 +4,10 @@ | |||
| 4 | * | 4 | * |
| 5 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> | 5 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> |
| 6 | * | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify | 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | * | ||
| 21 | */ | 8 | */ |
| 22 | 9 | ||
| 10 | #include "busybox.h" | ||
| 23 | #include <stdio.h> | 11 | #include <stdio.h> |
| 24 | #include <errno.h> | 12 | #include <errno.h> |
| 25 | #include <unistd.h> | 13 | #include <unistd.h> |
| @@ -29,7 +17,6 @@ | |||
| 29 | #include <string.h> | 17 | #include <string.h> |
| 30 | #include <sys/utsname.h> | 18 | #include <sys/utsname.h> |
| 31 | #include <sys/syscall.h> | 19 | #include <sys/syscall.h> |
| 32 | #include "busybox.h" | ||
| 33 | 20 | ||
| 34 | #ifdef CONFIG_FEATURE_2_6_MODULES | 21 | #ifdef CONFIG_FEATURE_2_6_MODULES |
| 35 | static inline void filename2modname(char *modname, const char *afterslash) | 22 | static inline void filename2modname(char *modname, const char *afterslash) |
