From d4cffd1cc3437910393c319215d14bd2dcaa4df6 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 21 Sep 2005 17:38:30 +0000 Subject: - make sure to include dmalloc.h at the very end of busybox.h or libbb.h. --- include/libbb.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'include/libbb.h') diff --git a/include/libbb.h b/include/libbb.h index b9794779d..c380ed739 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -34,15 +34,11 @@ #include -#ifdef DMALLOC -#include -#endif - #include #include "bb_config.h" #ifdef CONFIG_SELINUX -#include +#include #endif #include "pwd_.h" @@ -178,12 +174,12 @@ extern const char *bb_skip_whitespace(const char *); extern struct BB_applet *find_applet_by_name(const char *name); void run_applet_by_name(const char *name, int argc, char **argv); -//#warning is this needed anymore? -#ifndef DMALLOC -extern void *xmalloc (size_t size); +/* dmalloc will redefine these to it's own implementation. It is safe + * to have the prototypes here unconditionally. */ +extern void *xmalloc(size_t size); extern void *xrealloc(void *old, size_t size); extern void *xcalloc(size_t nmemb, size_t size); -#endif + extern char *bb_xstrdup (const char *s); extern char *bb_xstrndup (const char *s, int n); extern char *safe_strncpy(char *dst, const char *src, size_t size); @@ -420,7 +416,7 @@ extern void run_shell ( const char *shell, int loginshell, const char *command, #ifdef CONFIG_SELINUX extern void renew_current_security_context(void); extern void set_current_security_context(security_context_t sid); -#endif +#endif extern int run_parts(char **args, const unsigned char test_mode, char **env); extern int restricted_shell ( const char *shell ); extern void setup_environment ( const char *shell, int loginshell, int changeenv, const struct passwd *pw ); @@ -475,4 +471,9 @@ extern unsigned long get_ug_id(const char *s, long (*__bb_getxxnam)(const char * #define HASH_MD5 2 extern int hash_fd(int fd, const size_t size, const uint8_t hash_algo, uint8_t *hashval); +/* busybox.h will include dmalloc later for us, else include it here. */ +#if !defined _BB_INTERNAL_H_ && defined DMALLOC +#include +#endif + #endif /* __LIBCONFIG_H__ */ -- cgit v1.2.3