summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-11 19:33:36 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-13 17:56:54 -0400
commit6891529fe1176c046ece579807ff48e3191692f3 (patch)
tree0bbf054777f7a60d40c2afef2d541cb166ad7419 /src/core/unit.c
parent7ca9dffae1988a885e2e79c4bdca68169f4ca5ff (diff)
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.
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 4b9771076a..1db7d061c4 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2908,6 +2908,9 @@ int unit_remove_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name) {
return 0;
r = drop_in_file(u, mode, name, &p, &q);
+ if (r < 0)
+ return r;
+
if (unlink(q) < 0)
r = errno == ENOENT ? 0 : -errno;
else