From: Zbigniew Jędrzejewski-Szmek Date: Fri, 11 Oct 2013 23:33:36 +0000 (-0400) Subject: drop-ins: check return value X-Git-Tag: v209~1905 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=6891529fe1176c046ece579807ff48e3191692f3 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. --- diff --git a/src/core/unit.c b/src/core/unit.c index 4b9771076..1db7d061c 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