chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
main: newer kernels return EINVAL if we invoke reboot() in a container lacking perms...
[elogind.git]
/
src
/
core
/
load-fragment.c
diff --git
a/src/core/load-fragment.c
b/src/core/load-fragment.c
index 7fcd63a17a69b3d05124cf712a526f48225d1689..1f3da70aca34337bdd20383b0bcbf77f7be2c1ce 100644
(file)
--- a/
src/core/load-fragment.c
+++ b/
src/core/load-fragment.c
@@
-1376,10
+1376,16
@@
int config_parse_service_timeout(
r = config_parse_usec(filename, line, section, lvalue, ltype, rvalue, data, userdata);
r = config_parse_usec(filename, line, section, lvalue, ltype, rvalue, data, userdata);
- if (
!
r)
-
s->timeout_defined = true
;
+ if (r)
+
return r
;
- return r;
+ if (streq(lvalue, "TimeoutSec")) {
+ s->start_timeout_defined = true;
+ s->timeout_stop_usec = s->timeout_start_usec;
+ } else if (streq(lvalue, "TimeoutStartSec"))
+ s->start_timeout_defined = true;
+
+ return 0;
}
int config_parse_unit_env_file(
}
int config_parse_unit_env_file(
@@
-1463,6
+1469,7
@@
int config_parse_unit_condition_path(
Unit *u = data;
bool trigger, negate;
Condition *c;
Unit *u = data;
bool trigger, negate;
Condition *c;
+ _cleanup_free_ char *p = NULL;
assert(filename);
assert(lvalue);
assert(filename);
assert(lvalue);
@@
-1477,12
+1484,16
@@
int config_parse_unit_condition_path(
if (negate)
rvalue++;
if (negate)
rvalue++;
- if (!path_is_absolute(rvalue)) {
- log_error("[%s:%u] Path in condition not absolute, ignoring: %s", filename, line, rvalue);
+ p = unit_full_printf(u, rvalue);
+ if (!p)
+ return -ENOMEM;
+
+ if (!path_is_absolute(p)) {
+ log_error("[%s:%u] Path in condition not absolute, ignoring: %s", filename, line, p);
return 0;
}
return 0;
}
- c = condition_new(cond,
rvalue
, trigger, negate);
+ c = condition_new(cond,
p
, trigger, negate);
if (!c)
return -ENOMEM;
if (!c)
return -ENOMEM;
@@
-1504,21
+1515,29
@@
int config_parse_unit_condition_string(
Unit *u = data;
bool trigger, negate;
Condition *c;
Unit *u = data;
bool trigger, negate;
Condition *c;
+ _cleanup_free_ char *s = NULL;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
- if ((trigger = rvalue[0] == '|'))
+ trigger = rvalue[0] == '|';
+ if (trigger)
rvalue++;
rvalue++;
- if ((negate = rvalue[0] == '!'))
+ negate = rvalue[0] == '!';
+ if (negate)
rvalue++;
rvalue++;
- if (!(c = condition_new(cond, rvalue, trigger, negate)))
+ s = unit_full_printf(u, rvalue);
+ if (!s)
return -ENOMEM;
return -ENOMEM;
+ c = condition_new(cond, s, trigger, negate);
+ if (!c)
+ return log_oom();
+
LIST_PREPEND(Condition, conditions, u->conditions, c);
return 0;
}
LIST_PREPEND(Condition, conditions, u->conditions, c);
return 0;
}
@@
-2022,7
+2041,7
@@
int config_parse_syscall_filter(
ExecContext *c = data;
Unit *u = userdata;
ExecContext *c = data;
Unit *u = userdata;
- bool invert;
+ bool invert
= false
;
char *w;
size_t l;
char *state;
char *w;
size_t l;
char *state;
@@
-2287,7
+2306,6
@@
static int load_from_path(Unit *u, const char *path) {
goto finish;
}
goto finish;
}
- zero(st);
if (fstat(fileno(f), &st) < 0) {
r = -errno;
goto finish;
if (fstat(fileno(f), &st) < 0) {
r = -errno;
goto finish;