diff options
author | Tim Riker <tim@rikers.org> | 2002-12-14 01:58:59 +0000 |
---|---|---|
committer | Tim Riker <tim@rikers.org> | 2002-12-14 01:58:59 +0000 |
commit | cf93274663877cb4d722a23d8c418470eb90332a (patch) | |
tree | a056983d1162502b58e2aca4c2ebf3c9c7b9c6be /libbb | |
parent | 6fe1960ff5e4c7c993a8bc3add5361ee55323afe (diff) | |
download | busybox-w32-cf93274663877cb4d722a23d8c418470eb90332a.tar.gz busybox-w32-cf93274663877cb4d722a23d8c418470eb90332a.tar.bz2 busybox-w32-cf93274663877cb4d722a23d8c418470eb90332a.zip |
rmmod -a removed modules recursively
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/Makefile.in | 2 | ||||
-rw-r--r-- | libbb/qmodule.c | 29 |
2 files changed, 30 insertions, 1 deletions
diff --git a/libbb/Makefile.in b/libbb/Makefile.in index 3f4e77314..c97f7d2b3 100644 --- a/libbb/Makefile.in +++ b/libbb/Makefile.in | |||
@@ -38,7 +38,7 @@ LIBBB_SRC:= \ | |||
38 | my_getpwnam.c my_getpwnamegid.c my_getpwuid.c obscure.c parse_mode.c \ | 38 | my_getpwnam.c my_getpwnamegid.c my_getpwuid.c obscure.c parse_mode.c \ |
39 | parse_number.c perror_msg.c perror_msg_and_die.c print_file.c \ | 39 | parse_number.c perror_msg.c perror_msg_and_die.c print_file.c \ |
40 | process_escape_sequence.c procps.c pwd2spwd.c pw_encrypt.c \ | 40 | process_escape_sequence.c procps.c pwd2spwd.c pw_encrypt.c \ |
41 | read_package_field.c recursive_action.c remove_file.c \ | 41 | qmodule.c read_package_field.c recursive_action.c remove_file.c \ |
42 | restricted_shell.c run_parts.c run_shell.c safe_read.c safe_strncpy.c \ | 42 | restricted_shell.c run_parts.c run_shell.c safe_read.c safe_strncpy.c \ |
43 | setup_environment.c simplify_path.c syscalls.c syslog_msg_with_name.c \ | 43 | setup_environment.c simplify_path.c syscalls.c syslog_msg_with_name.c \ |
44 | time_string.c trim.c u_signal_names.c vdprintf.c verror_msg.c \ | 44 | time_string.c trim.c u_signal_names.c vdprintf.c verror_msg.c \ |
diff --git a/libbb/qmodule.c b/libbb/qmodule.c new file mode 100644 index 000000000..fd14d10fa --- /dev/null +++ b/libbb/qmodule.c | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | Copyright (C) 2002 Tim Riker <Tim@Rikers.org> | ||
3 | everyone seems to claim it someplace. ;-) | ||
4 | */ | ||
5 | |||
6 | #include <errno.h> | ||
7 | |||
8 | #include "libbb.h" | ||
9 | |||
10 | int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret); | ||
11 | |||
12 | int my_query_module(const char *name, int which, void **buf, | ||
13 | size_t *bufsize, size_t *ret) | ||
14 | { | ||
15 | int my_ret; | ||
16 | |||
17 | my_ret = query_module(name, which, *buf, *bufsize, ret); | ||
18 | |||
19 | if (my_ret == -1 && errno == ENOSPC) { | ||
20 | *buf = xrealloc(*buf, *ret); | ||
21 | *bufsize = *ret; | ||
22 | |||
23 | my_ret = query_module(name, which, *buf, *bufsize, ret); | ||
24 | } | ||
25 | |||
26 | return my_ret; | ||
27 | } | ||
28 | |||
29 | |||