load-fragment.c   load-fragment.c 
skipping to change at line 45 skipping to change at line 45
#include "unit.h" #include "unit.h"
#include "strv.h" #include "strv.h"
#include "conf-parser.h" #include "conf-parser.h"
#include "load-fragment.h" #include "load-fragment.h"
#include "log.h" #include "log.h"
#include "ioprio.h" #include "ioprio.h"
#include "securebits.h" #include "securebits.h"
#include "missing.h" #include "missing.h"
#include "unit-name.h" #include "unit-name.h"
#include "unit-printf.h"
#include "bus-errors.h" #include "bus-errors.h"
#include "utf8.h" #include "utf8.h"
#include "path-util.h" #include "path-util.h"
#include "syscall-list.h" #include "syscall-list.h"
#ifndef HAVE_SYSV_COMPAT #ifndef HAVE_SYSV_COMPAT
int config_parse_warn_compat( int config_parse_warn_compat(
const char *filename, const char *filename,
unsigned line, unsigned line,
const char *section, const char *section,
skipping to change at line 188 skipping to change at line 189
char *k; char *k;
int r; int r;
assert(filename); assert(filename);
assert(lvalue); assert(lvalue);
assert(rvalue); assert(rvalue);
assert(u); assert(u);
k = unit_full_printf(u, rvalue); k = unit_full_printf(u, rvalue);
if (!k) if (!k)
return -ENOMEM; return log_oom();
r = config_parse_path(filename, line, section, lvalue, ltype, k, da ta, userdata); r = config_parse_path(filename, line, section, lvalue, ltype, k, da ta, userdata);
free(k); free(k);
return r; return r;
} }
int config_parse_socket_listen( int config_parse_socket_listen(
const char *filename, const char *filename,
unsigned line, unsigned line,
skipping to change at line 1194 skipping to change at line 1195
const char *section, const char *section,
const char *lvalue, const char *lvalue,
int ltype, int ltype,
const char *rvalue, const char *rvalue,
void *data, void *data,
void *userdata) { void *userdata) {
Path *p = data; Path *p = data;
PathSpec *s; PathSpec *s;
PathType b; PathType b;
char *k;
assert(filename); assert(filename);
assert(lvalue); assert(lvalue);
assert(rvalue); assert(rvalue);
assert(data); assert(data);
if ((b = path_type_from_string(lvalue)) < 0) { b = path_type_from_string(lvalue);
if (b < 0) {
log_error("[%s:%u] Failed to parse path type, ignoring: %s" , filename, line, lvalue); log_error("[%s:%u] Failed to parse path type, ignoring: %s" , filename, line, lvalue);
return 0; return 0;
} }
if (!path_is_absolute(rvalue)) { k = unit_full_printf(UNIT(p), rvalue);
log_error("[%s:%u] Path is not absolute, ignoring: %s", fil if (!k)
ename, line, rvalue); return log_oom();
if (!path_is_absolute(k)) {
log_error("[%s:%u] Path is not absolute, ignoring: %s", fil
ename, line, k);
free(k);
return 0; return 0;
} }
if (!(s = new0(PathSpec, 1))) s = new0(PathSpec, 1);
return -ENOMEM; if (!s) {
free(k);
if (!(s->path = strdup(rvalue))) { return log_oom();
free(s);
return -ENOMEM;
} }
path_kill_slashes(s->path); s->path = path_kill_slashes(k);
s->type = b; s->type = b;
s->inotify_fd = -1; s->inotify_fd = -1;
LIST_PREPEND(PathSpec, spec, p->specs, s); LIST_PREPEND(PathSpec, spec, p->specs, s);
return 0; return 0;
} }
int config_parse_path_unit( int config_parse_path_unit(
const char *filename, const char *filename,
skipping to change at line 1471 skipping to change at line 1476
const char *lvalue, const char *lvalue,
int ltype, int ltype,
const char *rvalue, const char *rvalue,
void *data, void *data,
void *userdata) { void *userdata) {
ConditionType cond = ltype; ConditionType cond = ltype;
Unit *u = data; Unit *u = data;
bool trigger, negate; bool trigger, negate;
Condition *c; Condition *c;
_cleanup_free_ char *p = NULL;
assert(filename); assert(filename);
assert(lvalue); assert(lvalue);
assert(rvalue); assert(rvalue);
assert(data); assert(data);
trigger = rvalue[0] == '|'; trigger = rvalue[0] == '|';
if (trigger) if (trigger)
rvalue++; rvalue++;
negate = rvalue[0] == '!'; negate = rvalue[0] == '!';
if (negate) if (negate)
rvalue++; rvalue++;
if (!path_is_absolute(rvalue)) { p = unit_full_printf(u, rvalue);
log_error("[%s:%u] Path in condition not absolute, ignoring if (!p)
: %s", filename, line, rvalue); 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) if (!c)
return -ENOMEM; return -ENOMEM;
LIST_PREPEND(Condition, conditions, u->conditions, c); LIST_PREPEND(Condition, conditions, u->conditions, c);
return 0; return 0;
} }
int config_parse_unit_condition_string( int config_parse_unit_condition_string(
const char *filename, const char *filename,
unsigned line, unsigned line,
skipping to change at line 1512 skipping to change at line 1522
const char *lvalue, const char *lvalue,
int ltype, int ltype,
const char *rvalue, const char *rvalue,
void *data, void *data,
void *userdata) { void *userdata) {
ConditionType cond = ltype; ConditionType cond = ltype;
Unit *u = data; Unit *u = data;
bool trigger, negate; bool trigger, negate;
Condition *c; Condition *c;
_cleanup_free_ char *s = NULL;
assert(filename); assert(filename);
assert(lvalue); assert(lvalue);
assert(rvalue); assert(rvalue);
assert(data); assert(data);
trigger = rvalue[0] == '|'; trigger = rvalue[0] == '|';
if (trigger) if (trigger)
rvalue++; rvalue++;
negate = rvalue[0] == '!'; negate = rvalue[0] == '!';
if (negate) if (negate)
rvalue++; rvalue++;
c = condition_new(cond, rvalue, trigger, negate); s = unit_full_printf(u, rvalue);
if (!s)
return -ENOMEM;
c = condition_new(cond, s, trigger, negate);
if (!c) if (!c)
return log_oom(); return log_oom();
LIST_PREPEND(Condition, conditions, u->conditions, c); LIST_PREPEND(Condition, conditions, u->conditions, c);
return 0; return 0;
} }
int config_parse_unit_condition_null( int config_parse_unit_condition_null(
const char *filename, const char *filename,
unsigned line, unsigned line,
skipping to change at line 2033 skipping to change at line 2048
unsigned line, unsigned line,
const char *section, const char *section,
const char *lvalue, const char *lvalue,
int ltype, int ltype,
const char *rvalue, const char *rvalue,
void *data, void *data,
void *userdata) { void *userdata) {
ExecContext *c = data; ExecContext *c = data;
Unit *u = userdata; Unit *u = userdata;
bool invert; bool invert = false;
char *w; char *w;
size_t l; size_t l;
char *state; char *state;
assert(filename); assert(filename);
assert(lvalue); assert(lvalue);
assert(rvalue); assert(rvalue);
assert(u); assert(u);
if (rvalue[0] == '~') { if (rvalue[0] == '~') {
 End of changes. 13 change blocks. 
19 lines changed or deleted 34 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/