Export utils_stream_file_path outside of common/utils.c
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 10 May 2019 16:41:26 +0000 (12:41 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 25 Jul 2019 19:45:26 +0000 (15:45 -0400)
utils_stream_file_name is used by the stream file creation and
unlinking utilities. Those utilities perform actions that
will be performed on a trace chunk in a future commit.

Making this util public allows the reuse of most of the code
of the utilities.

The function is renamed from utils_stream_file_name to
utils_stream_file_path since it returns a path and not a
name.

The function's output parameter is moved to the end of the argument
list to honor the convention used in most of the code base. A length
parameter is added rather than relying on an implicit assumption
that the buffer's length is >= PATH_MAX.

The existing callers' buffer size is changed from PATH_MAX to
the preferred LTTNG_PATH_MAX.

The implementation of the function has been reworked to eliminate
a number of unncessary copies and allocations. It is now simpler,
handles path truncations, and does not duplicate the path separator
if it is already contained in `path_name`.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>

No differences found
This page took 0.027382 seconds and 5 git commands to generate.