cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: a Windows errno case (#1481217)

From: David Byron <DByron_at_telecomsys.com>
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:
>
> http://curl.haxx.se/bug/view.cgi?id=1481217

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
errors.

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.

-DB
Received on 2006-05-04