1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 20:25:38 +03:00

shared/install: failing with -ELOOP can be due to the use of an alias in install_error()

-ELOOP can happen also when enabling an alias name (which is admittedly useless
since the unit it belongs to was already enabled) so let's mention this
possibility when reporting the corresponding error.
This commit is contained in:
Franck Bui 2019-09-24 18:54:15 +02:00
parent 56a4ce2417
commit 2268367471

View File

@ -1903,11 +1903,13 @@ static int install_error(
case -ELOOP: case -ELOOP:
r = sd_bus_error_setf(error, BUS_ERROR_UNIT_LINKED, r = sd_bus_error_setf(error, BUS_ERROR_UNIT_LINKED,
"Refusing to operate on linked unit file %s", changes[i].path); "Refusing to operate on alias name or linked unit file: %s",
changes[i].path);
goto found; goto found;
case -ENOENT: case -ENOENT:
r = sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit file %s does not exist.", changes[i].path); r = sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT,
"Unit file %s does not exist.", changes[i].path);
goto found; goto found;
default: default: