From cf93274663877cb4d722a23d8c418470eb90332a Mon Sep 17 00:00:00 2001 From: Tim Riker Date: Sat, 14 Dec 2002 01:58:59 +0000 Subject: rmmod -a removed modules recursively --- libbb/Makefile.in | 2 +- libbb/qmodule.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 libbb/qmodule.c (limited to 'libbb') diff --git a/libbb/Makefile.in b/libbb/Makefile.in index 3f4e773..c97f7d2 100644 --- a/libbb/Makefile.in +++ b/libbb/Makefile.in @@ -38,7 +38,7 @@ LIBBB_SRC:= \ my_getpwnam.c my_getpwnamegid.c my_getpwuid.c obscure.c parse_mode.c \ parse_number.c perror_msg.c perror_msg_and_die.c print_file.c \ process_escape_sequence.c procps.c pwd2spwd.c pw_encrypt.c \ - read_package_field.c recursive_action.c remove_file.c \ + qmodule.c read_package_field.c recursive_action.c remove_file.c \ restricted_shell.c run_parts.c run_shell.c safe_read.c safe_strncpy.c \ setup_environment.c simplify_path.c syscalls.c syslog_msg_with_name.c \ 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 0000000..fd14d10 --- /dev/null +++ b/libbb/qmodule.c @@ -0,0 +1,29 @@ +/* + Copyright (C) 2002 Tim Riker + everyone seems to claim it someplace. ;-) +*/ + +#include + +#include "libbb.h" + +int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret); + +int my_query_module(const char *name, int which, void **buf, + size_t *bufsize, size_t *ret) +{ + int my_ret; + + my_ret = query_module(name, which, *buf, *bufsize, ret); + + if (my_ret == -1 && errno == ENOSPC) { + *buf = xrealloc(*buf, *ret); + *bufsize = *ret; + + my_ret = query_module(name, which, *buf, *bufsize, ret); + } + + return my_ret; +} + + -- cgit v1.1