diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-17 09:34:25 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-17 09:34:25 -0500 |
commit | 48317c39e26a203dc62d1f707263c75a79f89259 (patch) | |
tree | 7e7bea28184a1b0b751351df8a5a70be1b1c6fbb /src/network/networkd-route.c | |
parent | fd45e522dd8b6cbfdff32eee1f272a97080387ea (diff) |
network: change condition in if testing section presence
section_line and filename should be set together or not at all. Change the
if to test filename, since it's the first of the pair and it seems more natural
to test that.
Diffstat (limited to 'src/network/networkd-route.c')
-rw-r--r-- | src/network/networkd-route.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index ca606c3d25..a8ba293ae8 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -84,8 +84,9 @@ int route_new_static(Network *network, const char *filename, unsigned section_li assert(network); assert(ret); + assert(!!filename == (section_line > 0)); - if (section_line > 0) { + if (filename) { r = network_config_section_new(filename, section_line, &n); if (r < 0) return r; @@ -108,7 +109,7 @@ int route_new_static(Network *network, const char *filename, unsigned section_li route->protocol = RTPROT_STATIC; - if (section_line > 0) { + if (filename) { route->section = n; n = NULL; |