X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fload-fragment.c;h=b7e848c08ffc9d42b79d4c237676a56a36ad2bfc;hb=5b1869eaa22e365ab6595924fe96549b279b5ebc;hp=70ea13aa8005c3a33469e2ce8a7b4b0640e0f7a7;hpb=a57f7e2c828b852eb32fd810dcea041bb2975501;p=elogind.git diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 70ea13aa8..b7e848c08 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -34,8 +34,7 @@ #include #include -#include - +#include "sd-messages.h" #include "unit.h" #include "strv.h" #include "conf-parser.h" @@ -300,10 +299,10 @@ int config_parse_socket_listen(const char *unit, p->fd = -1; if (s->ports) { - LIST_FIND_TAIL(SocketPort, port, s->ports, tail); - LIST_INSERT_AFTER(SocketPort, port, s->ports, tail, p); + LIST_FIND_TAIL(port, s->ports, tail); + LIST_INSERT_AFTER(port, s->ports, tail, p); } else - LIST_PREPEND(SocketPort, port, s->ports, p); + LIST_PREPEND(port, s->ports, p); return 0; } @@ -1033,35 +1032,6 @@ int config_parse_sysv_priority(const char *unit, } #endif -int config_parse_fsck_passno(const char *unit, - const char *filename, - unsigned line, - const char *section, - const char *lvalue, - int ltype, - const char *rvalue, - void *data, - void *userdata) { - - int *passno = data; - int i, r; - - assert(filename); - assert(lvalue); - assert(rvalue); - assert(data); - - r = safe_atoi(rvalue, &i); - if (r || i < 0) { - log_syntax(unit, LOG_ERR, filename, line, -r, - "Failed to parse fsck pass number, ignoring: %s", rvalue); - return 0; - } - - *passno = (int) i; - return 0; -} - DEFINE_CONFIG_PARSE_ENUM(config_parse_kill_mode, kill_mode, KillMode, "Failed to parse kill mode"); int config_parse_kill_signal(const char *unit, @@ -1203,7 +1173,7 @@ int config_parse_timer(const char *unit, v->value = u; v->calendar_spec = c; - LIST_PREPEND(TimerValue, value, t->values, v); + LIST_PREPEND(value, t->values, v); return 0; } @@ -1323,7 +1293,7 @@ int config_parse_path_spec(const char *unit, s->type = b; s->inotify_fd = -1; - LIST_PREPEND(PathSpec, spec, p->specs, s); + LIST_PREPEND(spec, p->specs, s); return 0; } @@ -1657,7 +1627,7 @@ int config_parse_unit_condition_path(const char *unit, if (!c) return log_oom(); - LIST_PREPEND(Condition, conditions, u->conditions, c); + LIST_PREPEND(conditions, u->conditions, c); return 0; } @@ -1712,7 +1682,7 @@ int config_parse_unit_condition_string(const char *unit, if (!c) return log_oom(); - LIST_PREPEND(Condition, conditions, u->conditions, c); + LIST_PREPEND(conditions, u->conditions, c); return 0; } @@ -1766,7 +1736,7 @@ int config_parse_unit_condition_null(const char *unit, if (!c) return log_oom(); - LIST_PREPEND(Condition, conditions, u->conditions, c); + LIST_PREPEND(conditions, u->conditions, c); return 0; } @@ -1788,7 +1758,6 @@ int config_parse_unit_requires_mounts_for( char *state; size_t l; char *w; - int r; assert(filename); assert(lvalue); @@ -1796,6 +1765,7 @@ int config_parse_unit_requires_mounts_for( assert(data); FOREACH_WORD_QUOTED(w, l, rvalue, state) { + int r; _cleanup_free_ char *n; n = strndup(w, l); @@ -1816,7 +1786,7 @@ int config_parse_unit_requires_mounts_for( } } - return r; + return 0; } int config_parse_documentation(const char *unit, @@ -1860,7 +1830,8 @@ int config_parse_documentation(const char *unit, free(*a); } } - *b = NULL; + if (b) + *b = NULL; return r; } @@ -2127,7 +2098,7 @@ int config_parse_device_allow( a->w = !!strchr(m, 'w'); a->m = !!strchr(m, 'm'); - LIST_PREPEND(CGroupDeviceAllow, device_allow, c->device_allow, a); + LIST_PREPEND(device_allow, c->device_allow, a); return 0; } @@ -2233,7 +2204,7 @@ int config_parse_blockio_device_weight( w->weight = lu; - LIST_PREPEND(CGroupBlockIODeviceWeight, device_weights, c->blockio_device_weights, w); + LIST_PREPEND(device_weights, c->blockio_device_weights, w); return 0; } @@ -2309,7 +2280,7 @@ int config_parse_blockio_bandwidth( b->bandwidth = (uint64_t) bytes; b->read = read; - LIST_PREPEND(CGroupBlockIODeviceBandwidth, device_bandwidths, c->blockio_device_bandwidths, b); + LIST_PREPEND(device_bandwidths, c->blockio_device_bandwidths, b); return 0; } @@ -2707,7 +2678,6 @@ void unit_dump_config_items(FILE *f) { { config_parse_start_limit_action, "ACTION" }, { config_parse_set_status, "STATUS" }, { config_parse_service_sockets, "SOCKETS" }, - { config_parse_fsck_passno, "PASSNO" }, { config_parse_environ, "ENVIRON" }, { config_parse_syscall_filter, "SYSCALL" }, { config_parse_cpu_shares, "SHARES" },