From: Jérémie Galarneau Date: Fri, 10 May 2019 16:41:26 +0000 (-0400) Subject: Export utils_stream_file_path outside of common/utils.c X-Git-Tag: v2.12.0-rc1~561 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=40804255e7a6acd6fa76c41ee8e4e1cc2cefa49c;hp=40804255e7a6acd6fa76c41ee8e4e1cc2cefa49c;p=lttng-tools.git 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 ---