From: Willy Tarreau Date: Sun, 16 Aug 2009 08:08:02 +0000 (+0200) Subject: [MINOR] export the hostname variable so that all the code can access it X-Git-Tag: v1.4-dev3~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ad6a7640ba6bfbac6987dfa581c345bdc03100b;p=thirdparty%2Fhaproxy.git [MINOR] export the hostname variable so that all the code can access it The hostname variable will be used later, export it. --- diff --git a/include/common/defaults.h b/include/common/defaults.h index a2267b19d0..f0873cfae4 100644 --- a/include/common/defaults.h +++ b/include/common/defaults.h @@ -179,4 +179,9 @@ #define MAX_SIGNAL 256 #endif +/* Maximum host name length */ +#ifndef MAX_HOSTNAME_LEN +#define MAX_HOSTNAME_LEN 32 +#endif + #endif /* _COMMON_DEFAULTS_H */ diff --git a/include/types/global.h b/include/types/global.h index 1ba0b11804..542abfe356 100644 --- a/include/types/global.h +++ b/include/types/global.h @@ -95,6 +95,7 @@ extern const int zero; extern const int one; extern const struct linger nolinger; extern int stopping; /* non zero means stopping in progress */ +extern char hostname[MAX_HOSTNAME_LEN]; #endif /* _TYPES_GLOBAL_H */ diff --git a/src/haproxy.c b/src/haproxy.c index 2a4ed6a766..607ff155f4 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -152,12 +152,7 @@ const int zero = 0; const int one = 1; const struct linger nolinger = { .l_onoff = 1, .l_linger = 0 }; -/* - * Syslog facilities and levels. Conforming to RFC3164. - */ - -#define MAX_HOSTNAME_LEN 32 -static char hostname[MAX_HOSTNAME_LEN] = ""; +char hostname[MAX_HOSTNAME_LEN] = ""; /*********************************************************************/