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>
Thu, 2 Oct 2014 01:23:58 +0000 (02:23 +0100)
commit56fd04e41e9985260b8c1660e299cfe051d3f260
tree775f844b7f8eabffa3e7cfb0c9e1ea69119f1885
parent4fb0f88d53fc60395a4a87b7a9ca1245ba033ee7
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