blob: 4e4e79d38aa790bfa761642e2d5093ecb288087a [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Tim Rikercf932742002-12-14 01:58:59 +00002/*
3 Copyright (C) 2002 Tim Riker <Tim@Rikers.org>
4 everyone seems to claim it someplace. ;-)
5*/
6
7#include <errno.h>
8
9#include "libbb.h"
10
11int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret);
12
13int my_query_module(const char *name, int which, void **buf,
14 size_t *bufsize, size_t *ret)
15{
16 int my_ret;
17
18 my_ret = query_module(name, which, *buf, *bufsize, ret);
19
20 if (my_ret == -1 && errno == ENOSPC) {
21 *buf = xrealloc(*buf, *ret);
22 *bufsize = *ret;
23
24 my_ret = query_module(name, which, *buf, *bufsize, ret);
25 }
26
27 return my_ret;
28}
29
30