Blame SOURCES/0024-drop-ins-check-return-value.patch
|
|
9fc0f6 |
From 0b344626698e0c42a7da558783d70207f8aed05e Mon Sep 17 00:00:00 2001
|
|
|
9fc0f6 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
|
9fc0f6 |
Date: Fri, 11 Oct 2013 19:33:36 -0400
|
|
|
9fc0f6 |
Subject: [PATCH] drop-ins: check return value
|
|
|
9fc0f6 |
|
|
|
9fc0f6 |
If the function failed, nothing serious would happen
|
|
|
9fc0f6 |
because unlink would probably return EFAULT, but this
|
|
|
9fc0f6 |
would obscure the real error and is a bit sloppy.
|
|
|
9fc0f6 |
---
|
|
|
9fc0f6 |
src/core/unit.c | 3 +++
|
|
|
9fc0f6 |
1 file changed, 3 insertions(+)
|
|
|
9fc0f6 |
|
|
|
9fc0f6 |
diff --git a/src/core/unit.c b/src/core/unit.c
|
|
|
9fc0f6 |
index 4b97710..1db7d06 100644
|
|
|
9fc0f6 |
--- a/src/core/unit.c
|
|
|
9fc0f6 |
+++ b/src/core/unit.c
|
|
|
9fc0f6 |
@@ -2908,6 +2908,9 @@ int unit_remove_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name) {
|
|
|
9fc0f6 |
return 0;
|
|
|
9fc0f6 |
|
|
|
9fc0f6 |
r = drop_in_file(u, mode, name, &p, &q);
|
|
|
9fc0f6 |
+ if (r < 0)
|
|
|
9fc0f6 |
+ return r;
|
|
|
9fc0f6 |
+
|
|
|
9fc0f6 |
if (unlink(q) < 0)
|
|
|
9fc0f6 |
r = errno == ENOENT ? 0 : -errno;
|
|
|
9fc0f6 |
else
|