Print correct error when /dev/net/tun open fails
authorDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 22 Jun 2012 09:03:01 +0000 (10:03 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 22 Jun 2012 09:06:36 +0000 (10:06 +0100)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
tun.c
www/changelog.xml

diff --git a/tun.c b/tun.c
index d708caa..a9e18ac 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -485,7 +485,7 @@ static int os_setup_tun(struct openconnect_info *vpninfo)
        if (tun_fd < 0) {
                /* If the error on /dev/tun is ENOENT, that's boring.
                   Use the error we got on /dev/net/tun instead */
-               if (errno != -ENOENT)
+               if (errno != ENOENT)
                        tunerr = errno;
 
                vpn_progress(vpninfo, PRG_ERR,
index d2f2786..dda57fd 100644 (file)
@@ -17,6 +17,7 @@
 <ul>
    <li><b>OpenConnect HEAD</b>
      <ul>
+       <li>Print correct error when <tt>/dev/net/tun</tt> cannot be opened.</li>
        <li>Fix <tt>openconnect.pc</tt> pkg-config file not to require <tt>zlib.pc</tt> on systems which lack it (like RHEL5).</li>
      </ul><br/>
   </li>