chiark / gitweb /
fds: Simplify fd close condition in tun_set_route
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Sep 2014 10:58:42 +0000 (11:58 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Sep 2014 11:08:55 +0000 (12:08 +0100)
commitcab110dcaffc3e8eee681d479883e87fca80b9c3
treee651f7c7d33420d50f51cd9fb62ebbb8c6b08962
parentccf25024a3b46e9ca2b1842883b2f0953daf4842
fds: Simplify fd close condition in tun_set_route

Recreating the condition under which the fd was opened is confusing
and fragile.  Instead, simply close it if we opened it, which we can
tell from the value of the variable (because we initialise it to -1 at
the top).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tun.c