summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-27 01:23:16 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-27 01:23:16 -0500
commit70b64bd3561c2bbe6cad2e590d4e3e25426f75b5 (patch)
treee1597e599168b833caea1f34e46167a54bdafe34 /src/core
parentfd08a8403f8c4075db95a0a4aec92689897c1e63 (diff)
core: simplify check for path absoluteness
Just a microopt.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/unit.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index e3b620603c..fc1465834c 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2997,17 +2997,15 @@ int unit_require_mounts_for(Unit *u, const char *path) {
* units can easily determine which units to make themselves a
* dependency of. */
+ if (!path_is_absolute(path))
+ return -EINVAL;
+
p = strdup(path);
if (!p)
return -ENOMEM;
path_kill_slashes(p);
- if (!path_is_absolute(p)) {
- free(p);
- return -EINVAL;
- }
-
if (!path_is_safe(p)) {
free(p);
return -EPERM;