chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
7ca9dff
)
drop-ins: check return value
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Fri, 11 Oct 2013 23:33:36 +0000
(19:33 -0400)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Sun, 13 Oct 2013 21:56:54 +0000
(17:56 -0400)
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.
src/core/unit.c
patch
|
blob
|
history
diff --git
a/src/core/unit.c
b/src/core/unit.c
index 4b9771076aa36539a7ff1423094b19322c299c37..1db7d061c4d46437f98a5808c88b3ef0bb1c8272 100644
(file)
--- 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