X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Finstall.c;h=100ed69744ad4f8383b13bb666743f843b838854;hb=df41aaf9a2b195c9a8bb6fca6672cbf25bc147fb;hp=881f715a075976fa131c9347ca505b5e60423a80;hpb=16ed0233a5b7ae38ed4f544d6fcd5827cde695dc;p=elogind.git diff --git a/src/shared/install.c b/src/shared/install.c index 881f715a0..100ed6974 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -922,6 +922,7 @@ static int config_parse_also(const char *unit, const char *filename, unsigned line, const char *section, + unsigned section_line, const char *lvalue, int ltype, const char *rvalue, @@ -957,6 +958,7 @@ static int config_parse_user(const char *unit, const char *filename, unsigned line, const char *section, + unsigned section_line, const char *lvalue, int ltype, const char *rvalue, @@ -1562,6 +1564,7 @@ int unit_file_set_default( UnitFileScope scope, const char *root_dir, const char *file, + bool force, UnitFileChange **changes, unsigned *n_changes) { @@ -1599,7 +1602,7 @@ int unit_file_set_default( path = strappenda(config_path, "/" SPECIAL_DEFAULT_TARGET); - r = create_symlink(i->path, path, true, changes, n_changes); + r = create_symlink(i->path, path, force, changes, n_changes); if (r < 0) return r; @@ -1638,10 +1641,14 @@ int unit_file_get_default( r = readlink_malloc(path, &tmp); if (r == -ENOENT) continue; - if (r < 0) + else if (r == -EINVAL) + /* not a symlink */ + n = strdup(SPECIAL_DEFAULT_TARGET); + else if (r < 0) return r; + else + n = strdup(path_get_file_name(tmp)); - n = strdup(path_get_file_name(tmp)); if (!n) return -ENOMEM;