cURL / Mailing Lists / curl-library / Single Mail


RE: a Windows errno case (#1481217)

From: David Byron <>
Date: Thu, 4 May 2006 10:23:25 -0700

On Wednesday, May 3, Daniel wrote:

> Roland Blom submitted this interesting bug report called
> #1481217 about how we don't currently get the "errno"
> properly on Windows, and I would really appreciate some
> Windows-aware people to have a glance at it and possibly
> comment his ideas/suggestions:

I think he's pretty much right. I looked through the code and the calls
Curl_ourerrno seem to be after socket calls where WSAGetLastError is
appropriate. I think the name Curl_ourerrno might not be quite the
right name for the function though...if it's only dealing with socket

There are other places in the code that use errno directly which is the
right thing in a lot of cases. Some of them should probably be
Curl_ourerrno calls instead (e.g. lib/ftp.c 1.359 line 495). There are
also files that #include <errno.h> that don't use it (e.g. lib/hostsyn.c
and lib/telnet.c).

There are also Windows functions where calling GetLastError (not errno
and not WSAGetLastError) is the way to look for errors. Not sure if
curl uses any of those functions though. Resolving this is a separate
task, but it may influence the name of the Curl_ourerrno function.

Received on 2006-05-04