Differential D30048 Diff 89095 sysutils/lttng-tools/files/patch-src_bin_lttng-sessiond_ust-metadata.c
Changeset View
Changeset View
Standalone View
Standalone View
sysutils/lttng-tools/files/patch-src_bin_lttng-sessiond_ust-metadata.c
--- src/bin/lttng-sessiond/ust-metadata.c.orig 2016-11-29 22:48:37 UTC | --- src/bin/lttng-sessiond/ust-metadata.c.orig 2017-01-09 19:26:28 UTC | ||||
+++ src/bin/lttng-sessiond/ust-metadata.c | +++ src/bin/lttng-sessiond/ust-metadata.c | ||||
@@ -50,6 +50,7 @@ int _lttng_field_statedump(struct ust_re | @@ -50,6 +50,7 @@ int _lttng_field_statedump(struct ust_registry_session | ||||
const struct ustctl_field *fields, size_t nr_fields, | const struct ustctl_field *fields, size_t nr_fields, | ||||
size_t *iter_field, size_t nesting); | size_t *iter_field, size_t nesting); | ||||
+#if !defined(__FreeBSD__) | +#if !defined(__FreeBSD__) | ||||
static inline | static inline | ||||
int fls(unsigned int x) | int fls(unsigned int x) | ||||
{ | { | ||||
@@ -79,6 +80,7 @@ int fls(unsigned int x) | @@ -79,6 +80,7 @@ int fls(unsigned int x) | ||||
} | } | ||||
return r; | return r; | ||||
} | } | ||||
+#endif | +#endif | ||||
static inline | static inline | ||||
int get_count_order(unsigned int count) | int get_count_order(unsigned int count) | ||||
@@ -879,6 +881,9 @@ int ust_metadata_session_statedump(struc | @@ -879,7 +881,7 @@ int ust_metadata_session_statedump(struct ust_registry | ||||
char uuid_s[UUID_STR_LEN], | char uuid_s[UUID_STR_LEN], | ||||
clock_uuid_s[UUID_STR_LEN]; | clock_uuid_s[UUID_STR_LEN]; | ||||
int ret = 0; | int ret = 0; | ||||
+#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]; | |||||
assert(session); | assert(session); | ||||
@@ -940,7 +942,7 @@ int ust_metadata_session_statedump(struct ust_registry | |||||
hostname[0] = '\0'; | |||||
ret = gethostname(hostname, sizeof(hostname)); | |||||
if (ret && errno == ENAMETOOLONG) | |||||
- hostname[HOST_NAME_MAX - 1] = '\0'; | |||||
+ hostname[_POSIX_HOST_NAME_MAX - 1] = '\0'; | |||||
ret = lttng_metadata_printf(session, | |||||
"env {\n" | |||||
" hostname = \"%s\";\n" |