X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Finstall.c;h=acfba25b245e9b8e89ccb0ba89b8f0813e43beb1;hb=76cf10dab7a36653a159f0e87c46a13df494474f;hp=74090463d9547a0fff77248382f13c51ef8518b4;hpb=03e334a1c7dc8c20c38902aa039440763acc9b17;p=elogind.git diff --git a/src/shared/install.c b/src/shared/install.c index 74090463d..acfba25b2 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -1170,7 +1170,9 @@ static int create_symlink( if (!force) return -EEXIST; - unlink(new_path); + r = unlink(new_path); + if (r < 0 && errno != ENOENT) + return -errno; if (symlink(old_path, new_path) >= 0) { add_file_change(changes, n_changes, UNIT_FILE_UNLINK, new_path, NULL); @@ -1492,8 +1494,8 @@ int unit_file_enable( supposed to be created, not the ones actually created. This is useful to determine whether the passed files had any installation data at all. */ - r = install_context_apply(&c, &paths, config_path, root_dir, force, changes, n_changes); - return r; + + return install_context_apply(&c, &paths, config_path, root_dir, force, changes, n_changes); } int unit_file_disable(