[systemd-devel] [PATCH 1/2] path-util: add path_make_relative()

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Mon May 19 01:13:01 PDT 2014


On Fri, 2014-05-16 at 18:46 +0200, Lennart Poettering wrote:
> On Sat, 03.05.14 11:52, Tanu Kaskinen (tanu.kaskinen at linux.intel.com) wrote:
> 
> > In user_dirs() in path-lookup.c, I want to replace this:
> >         symlink("../../../.config/systemd/user", data_home);
> > with
> >         symlink(config_home, data_home);
> > to avoid hardcoding .config when XDG_CONFIG_HOME is set.
> > 
> > The problem is that config_home is an absolute path, and it's better
> > to make the symlink relative. path_make_relative() is an utility
> > function that converts an absolute path into a relative one.
> 
> Sounds very useful, but I think for things like this it would be good to
> have a test case?

Ok, will do.

> Sounds awfully hard to make sure this works correctly
> without actually testing this...

Yes. I actually did test the function, I just didn't make the test a
proper test case (I haven't looked how testing is done in systemd).

-- 
Tanu



More information about the systemd-devel mailing list