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:
fd08a84
)
core: simplify check for path absoluteness
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 27 Jan 2014 06:23:16 +0000
(
01:23
-0500)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 27 Jan 2014 06:23:16 +0000
(
01:23
-0500)
Just a microopt.
src/core/unit.c
patch
|
blob
|
history
diff --git
a/src/core/unit.c
b/src/core/unit.c
index e3b620603cf2c489ba10e5063a7e923a8bd5d2ee..fc1465834c0d84da8e64e860567f3a14d720d56a 100644
(file)
--- 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;