chiark / gitweb /
systemctl: fix broken list-unit-files with --root
authorLukas Nykryn <lnykryn@redhat.com>
Mon, 25 Aug 2014 13:29:50 +0000 (15:29 +0200)
committerLukas Nykryn <lnykryn@redhat.com>
Mon, 25 Aug 2014 13:51:55 +0000 (15:51 +0200)
This patch modifies unit_file_get_list which will now return
hashmap of structures where f->path is *without* root_dir prefix.

This change should be ok, because current code either does not use
root_dir at all or calls basename() on the f->path.

src/shared/install.c

index 4b09a69456fd71fab4bf9c7bb113607d3747c9e2..a07d1dd31577a73172be3eeec7675c18ab374332 100644 (file)
@@ -2099,7 +2099,7 @@ int unit_file_get_list(
                         if (!f)
                                 return -ENOMEM;
 
                         if (!f)
                                 return -ENOMEM;
 
-                        f->path = path_make_absolute(de->d_name, units_dir);
+                        f->path = path_make_absolute(de->d_name, *i);
                         if (!f->path)
                                 return -ENOMEM;
 
                         if (!f->path)
                                 return -ENOMEM;