Changeset View
Changeset View
Standalone View
Standalone View
sysutils/lttng-tools/files/patch-src_bin_lttng_commands_view.c
--- src/bin/lttng/commands/view.c.orig 2016-11-29 22:48:37 UTC | --- src/bin/lttng/commands/view.c.orig 2017-01-09 19:26:28 UTC | ||||
+++ src/bin/lttng/commands/view.c | +++ src/bin/lttng/commands/view.c | ||||
@@ -269,6 +269,9 @@ static char *build_live_path(char *sessi | @@ -17,6 +17,7 @@ | ||||
#define _LGPL_SOURCE | |||||
#include <popt.h> | |||||
+#include <limits.h> | |||||
#include <stdio.h> | |||||
#include <stdlib.h> | |||||
#include <string.h> | |||||
@@ -269,7 +270,7 @@ static char *build_live_path(char *session_name) | |||||
{ | { | ||||
int ret; | int ret; | ||||
char *path = NULL; | char *path = NULL; | ||||
+#if defined(__FreeBSD__) | - char hostname[HOST_NAME_MAX]; | ||||
+ const size_t HOST_NAME_MAX = sysconf(_SC_HOST_NAME_MAX); | + char hostname[_POSIX_HOST_NAME_MAX]; | ||||
+#endif | |||||
char hostname[HOST_NAME_MAX]; | |||||
ret = gethostname(hostname, sizeof(hostname)); | ret = gethostname(hostname, sizeof(hostname)); | ||||
if (ret < 0) { |