[lttng-dev] [lttng-tools PATCH 0/2] utils_expand_path as realpath(3) for non-existing directories

Raphaël Beamonte raphael.beamonte at gmail.com
Thu Nov 7 23:32:12 EST 2013


The utils_expand_path function of lttng-tools, in src/common/utils.c,
was meant to replace the realpath(3) function of glibc in cases we
want to allow non-existing paths, such as specifying the output directory
for a trace.
While using the lttng-tools command line to create some traces, I found
out that some use cases weren't working. For instance, using paths like
"foo", "bar/" or "bar/foo" when the "bar" directory does not exist was
not working.

This series of two (2) patches aims to correct the behavior of the
utils_expand_path function, introducing a new utils_resolve_relative
function meant to resolve relative paths ("./" and "../") in the middle
of a path string.


Raphaël Beamonte (2):
  Introduce a new utils_resolve_relative function
  Correct the behavior of the utils_expand_path function

 src/common/utils.c |  120 +++++++++++++++++++++++++++++++++++++++++++---------
 src/common/utils.h |    1 +
 2 files changed, 100 insertions(+), 21 deletions(-)

-- 
1.7.10.4




More information about the lttng-dev mailing list