UnitDependency d = ltype;
Unit *u = userdata;
- char *w;
+ char *w, *state;
size_t l;
- char *state;
assert(filename);
assert(lvalue);
void *data,
void *userdata) {
- CGroupContext *c = data;
- unsigned long lu;
+ unsigned long *shares = data, lu;
int r;
assert(filename);
assert(rvalue);
if (isempty(rvalue)) {
- c->cpu_shares = 1024;
+ *shares = (unsigned long) -1;
return 0;
}
r = safe_atolu(rvalue, &lu);
if (r < 0 || lu <= 0) {
- log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "CPU shares '%s' invalid. Ignoring.", rvalue);
+ log_syntax(unit, LOG_ERR, filename, line, EINVAL, "CPU shares '%s' invalid. Ignoring.", rvalue);
return 0;
}
- c->cpu_shares = lu;
+ *shares = lu;
return 0;
}
void *data,
void *userdata) {
- CGroupContext *c = data;
- unsigned long lu;
+ unsigned long *weight = data, lu;
int r;
assert(filename);
assert(rvalue);
if (isempty(rvalue)) {
- c->blockio_weight = 1000;
+ *weight = (unsigned long) -1;
return 0;
}
r = safe_atolu(rvalue, &lu);
if (r < 0 || lu < 10 || lu > 1000) {
- log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "Block IO weight '%s' invalid. Ignoring.", rvalue);
+ log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Block IO weight '%s' invalid. Ignoring.", rvalue);
return 0;
}
- c->blockio_weight = lu;
-
+ *weight = lu;
return 0;
}
n = strcspn(rvalue, WHITESPACE);
weight = rvalue + n;
if (!*weight) {
- log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "Expected block device and device weight. Ignoring.");
+ log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Expected block device and device weight. Ignoring.");
return 0;
}
return log_oom();
if (!path_startswith(path, "/dev")) {
- log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "Invalid device node path '%s'. Ignoring.", path);
+ log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Invalid device node path '%s'. Ignoring.", path);
return 0;
}
weight += strspn(weight, WHITESPACE);
r = safe_atolu(weight, &lu);
if (r < 0 || lu < 10 || lu > 1000) {
- log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "Block IO weight '%s' invalid. Ignoring.", rvalue);
+ log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Block IO weight '%s' invalid. Ignoring.", rvalue);
return 0;
}
-
w = new0(CGroupBlockIODeviceWeight, 1);
if (!w)
return log_oom();
return 0;
}
-int config_parse_no_new_priviliges(
+int config_parse_no_new_privileges(
const char* unit,
const char *filename,
unsigned line,