summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGergely Nagy <algernon@balabit.hu>2012-03-24 15:52:25 +0100
committerGergely Nagy <algernon@balabit.hu>2012-03-24 15:52:25 +0100
commitc515ced437047b459cfce6b6a34eb572558566f9 (patch)
tree8edac49a71c8c4b62bf10f20e8b33d699ff078c0 /lib
parent99dd3a3f8dc881c0f4939205dc4c04bb6ea0c149 (diff)
downloadlibumberlog-c515ced437047b459cfce6b6a34eb572558566f9.tar.gz
libumberlog-c515ced437047b459cfce6b6a34eb572558566f9.tar.xz
libumberlog-c515ced437047b459cfce6b6a34eb572558566f9.zip
Portability fixes
Use _POSIX_HOST_NAME_MAX instead of HOST_NAME_MAX: both Linux and FreeBSD have the former, but FreeBSD does not have HOST_NAME_MAX in limits.h Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Diffstat (limited to 'lib')
-rw-r--r--lib/umberlog.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/umberlog.c b/lib/umberlog.c
index 516f41c..e2d72de 100644
--- a/lib/umberlog.c
+++ b/lib/umberlog.c
@@ -64,7 +64,7 @@ static __thread struct
uid_t uid;
gid_t gid;
const char *ident;
- char hostname[HOST_NAME_MAX + 1];
+ char hostname[_POSIX_HOST_NAME_MAX + 1];
} ul_sys_settings;
static void
@@ -91,7 +91,7 @@ ul_openlog (const char *ident, int option, int facility)
ul_sys_settings.uid = getuid ();
ul_sys_settings.ident = ident;
- gethostname (ul_sys_settings.hostname, HOST_NAME_MAX);
+ gethostname (ul_sys_settings.hostname, _POSIX_HOST_NAME_MAX);
}
/** HELPERS **/
@@ -156,7 +156,7 @@ static inline const char *
_get_hostname (void)
{
if (ul_sys_settings.flags & LOG_UL_NOCACHE)
- gethostname (ul_sys_settings.hostname, HOST_NAME_MAX);
+ gethostname (ul_sys_settings.hostname, _POSIX_HOST_NAME_MAX);
return ul_sys_settings.hostname;
}