Nmap Development mailing list archives

Re: Problem with errno under VS2013


From: Gisle Vanem <gvanem () yahoo no>
Date: Tue, 25 Nov 2014 12:17:35 +0000

Daniel Miller wrote:

When debugging, the pseudo-register @err,hr shows ERROR_FILE_NOT_FOUND with a value of 2, which corresponds directly to
the ENOENT error we are trying to check for. I just don't understand why it's not being set in errno.

When just preprocessing with MSVC v16 (VS2010 on Win-XP),
I see this:

static int rename_file(const char *from_filename, const char *to_filename)
{
        int rc;
        (*_errno()) = 0;
        rc = unlink(to_filename);
        if (rc == -1 && (*_errno()) != 2)
                return -1;
        return rename(from_filename, to_filename);
}

Which looks correct. Try the same on VS2013. Just add '-E' to
your CFLAGS. It would not amaze me if the CPP output is different
under VS2013.

--
--gv
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: