Export utils_stream_file_path outside of common/utils.c
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>
This page took 0.026903 seconds and 5 git commands to generate.