systemd-coredump: allow setting external core size to infinity
Make it compatible to the ulimit setting: unlimited
This commit is contained in:
committed by
Lennart Poettering
parent
548614cc9a
commit
6e8791a042
@@ -677,6 +677,31 @@ int config_parse_iec_uint64(
|
||||
return 0;
|
||||
}
|
||||
|
||||
int config_parse_iec_uint64_infinity(
|
||||
const char* unit,
|
||||
const char *filename,
|
||||
unsigned line,
|
||||
const char *section,
|
||||
unsigned section_line,
|
||||
const char *lvalue,
|
||||
int ltype,
|
||||
const char *rvalue,
|
||||
void *data,
|
||||
void *userdata) {
|
||||
|
||||
uint64_t *bytes = data;
|
||||
|
||||
assert(rvalue);
|
||||
assert(data);
|
||||
|
||||
if (streq(rvalue, "infinity")) {
|
||||
*bytes = UINT64_MAX;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return config_parse_iec_uint64(unit, filename, line, section, section_line, lvalue, ltype, rvalue, data, userdata);
|
||||
}
|
||||
|
||||
int config_parse_bool(
|
||||
const char* unit,
|
||||
const char *filename,
|
||||
|
||||
@@ -126,6 +126,7 @@ CONFIG_PARSER_PROTOTYPE(config_parse_double);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_iec_size);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_si_uint64);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_iec_uint64);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_iec_uint64_infinity);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_bool);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_id128);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_tristate);
|
||||
|
||||
Reference in New Issue
Block a user