Fix: set hidden attribute to utils_* calls
[lttng-tools.git] / src / common / utils.c
index 3e659a1c81079d74b52aab9993c555fcaba6b62d..d0f050c0ff14d12e79f4f36d2e7adddb807e341d 100644 (file)
@@ -32,6 +32,7 @@
 #include <common/runas.h>
 
 #include "utils.h"
+#include "defaults.h"
 
 /*
  * Return the realpath(3) of the path even if the last directory token does not
@@ -307,7 +308,7 @@ error:
  * Return 0 on success or else a negative value.
  */
 LTTNG_HIDDEN
-int utils_create_stream_file(char *path_name, char *file_name, uint64_t size,
+int utils_create_stream_file(const char *path_name, char *file_name, uint64_t size,
                uint64_t count, int uid, int gid)
 {
        int ret, out_fd, flags, mode;
@@ -440,6 +441,7 @@ static void regex_print_error(int errcode, regex_t *regex)
  *
  * @return 0 on success, -1 on failure.
  */
+LTTNG_HIDDEN
 int utils_parse_size_suffix(char *str, uint64_t *size)
 {
        regex_t regex;
@@ -580,3 +582,18 @@ int utils_get_count_order_u32(uint32_t x)
 
        return fls_u32(x - 1);
 }
+
+/**
+ * Obtain the value of LTTNG_HOME environment variable, if exists.
+ * Otherwise returns the value of HOME.
+ */
+LTTNG_HIDDEN
+char *utils_get_home_dir(void)
+{
+       char *val = NULL;
+       val = getenv(DEFAULT_LTTNG_HOME_ENV_VAR);
+       if (val != NULL) {
+               return val;
+       }
+       return getenv(DEFAULT_LTTNG_FALLBACK_HOME_ENV_VAR);
+}
This page took 0.023887 seconds and 4 git commands to generate.