chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
core: convert PID 1 to libsystemd-bus
[elogind.git]
/
src
/
shared
/
install.c
diff --git
a/src/shared/install.c
b/src/shared/install.c
index 881f715a075976fa131c9347ca505b5e60423a80..16504eef0fe7aee6c4306de9a8dbc7e5c7c80ef8 100644
(file)
--- a/
src/shared/install.c
+++ b/
src/shared/install.c
@@
-1562,6
+1562,7
@@
int unit_file_set_default(
UnitFileScope scope,
const char *root_dir,
const char *file,
UnitFileScope scope,
const char *root_dir,
const char *file,
+ bool force,
UnitFileChange **changes,
unsigned *n_changes) {
UnitFileChange **changes,
unsigned *n_changes) {
@@
-1599,7
+1600,7
@@
int unit_file_set_default(
path = strappenda(config_path, "/" SPECIAL_DEFAULT_TARGET);
path = strappenda(config_path, "/" SPECIAL_DEFAULT_TARGET);
- r = create_symlink(i->path, path,
tru
e, changes, n_changes);
+ r = create_symlink(i->path, path,
forc
e, changes, n_changes);
if (r < 0)
return r;
if (r < 0)
return r;
@@
-1638,10
+1639,14
@@
int unit_file_get_default(
r = readlink_malloc(path, &tmp);
if (r == -ENOENT)
continue;
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;
return r;
+ else
+ n = strdup(path_get_file_name(tmp));
- n = strdup(path_get_file_name(tmp));
if (!n)
return -ENOMEM;
if (!n)
return -ENOMEM;