mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-06-15 18:25:53 +00:00
drop-ins: check return value
If the function failed, nothing serious would happen because unlink would probably return EFAULT, but this would obscure the real error and is a bit sloppy. Conflicts: src/core/unit.c
This commit is contained in:
@@ -2940,6 +2940,9 @@ int unit_remove_drop_in(Unit *u, bool runtime, const char *name) {
|
||||
assert(u);
|
||||
|
||||
r = drop_in_file(u, runtime, name, &p, &q);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (unlink(q) < 0)
|
||||
r = -errno;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user