Skip to content

mingw_setsockopt() should set errno #2404

Closed
@jeffhostetler

Description

@jeffhostetler

On Windows, setsockopt() is mapped to mingw_setsockopt() which calls
the WinSock/WSA version of setsockopt(). This routine is documented as
setting an internal error code that is available via WSAGetLastError().

Core Git callers of setsockopt() (connect.c, daemon.c, http.c) assume that
when -1 is returned, that errno contains the reason. But on Windows, this
is not true. This results in a random error message being printed.

Observed in 2.24.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions