# [PATCH ew/daemon-socket-keepalive] Windows: add missing definition of ENOTSOCK

6 messages from 2016-07-21 to 2016-07-23. Participants: Johannes Sixt, Johannes Schindelin, Junio C Hamano, Eric Wong.
Thread: https://gitlist.dev/t/42902

## Johannes Sixt, 2016-07-21 20:59

Subject: [PATCH ew/daemon-socket-keepalive] Windows: add missing definition of ENOTSOCK
Message-ID: <28dbe3b0-7a16-1b87-3d59-b8c981fead7c@kdbg.org>
URL: https://gitlist.dev/e/28dbe3b0-7a16-1b87-3d59-b8c981fead7c%40kdbg.org

```
The previous commit introduced the first use of ENOTSOCK. This macro is
not available on Windows. Define it as WSAENOTSOCK because that is the
corresponding error value reported by the Windows versions of socket
functions.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
  compat/mingw.h | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/compat/mingw.h b/compat/mingw.h
index 233933e..95e128f 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -73,6 +73,9 @@ typedef int pid_t;
  #ifndef ECONNABORTED
  #define ECONNABORTED WSAECONNABORTED
  #endif
+#ifndef ENOTSOCK
+#define ENOTSOCK WSAENOTSOCK
+#endif

  struct passwd {
  	char *pw_name;
-- 
2.9.0.443.ga8520ad


```

## Johannes Schindelin, 2016-07-22 08:21

Subject: Re: [PATCH ew/daemon-socket-keepalive] Windows: add missing definition of ENOTSOCK
Message-ID: <alpine.DEB.2.20.1607221020520.14111@virtualbox>
URL: https://gitlist.dev/e/alpine.DEB.2.20.1607221020520.14111%40virtualbox
In-Reply-To: <28dbe3b0-7a16-1b87-3d59-b8c981fead7c@kdbg.org>

```
Hi Hannes,

On Thu, 21 Jul 2016, Johannes Sixt wrote:

> The previous commit introduced the first use of ENOTSOCK. This macro is
> not available on Windows. Define it as WSAENOTSOCK because that is the
> corresponding error value reported by the Windows versions of socket
> functions.

Thanks for catching this early.

Ciao,
Dscho

```

## Junio C Hamano, 2016-07-22 19:28

Subject: Re: [PATCH ew/daemon-socket-keepalive] Windows: add missing definition of ENOTSOCK
Message-ID: <xmqqmvl9a2wc.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqmvl9a2wc.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <alpine.DEB.2.20.1607221020520.14111@virtualbox>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi Hannes,
>
> On Thu, 21 Jul 2016, Johannes Sixt wrote:
>
>> The previous commit introduced the first use of ENOTSOCK. This macro is
>> not available on Windows. Define it as WSAENOTSOCK because that is the
>> corresponding error value reported by the Windows versions of socket
>> functions.
>
> Thanks for catching this early.

(is that an acked/reviewed-by?  it is OK if it is not).

Yeah, thanks, both.

```

## Eric Wong, 2016-07-22 19:31

Subject: Re: [PATCH ew/daemon-socket-keepalive] Windows: add missing definition of ENOTSOCK
Message-ID: <20160722193156.GA30158@dcvr>
URL: https://gitlist.dev/e/20160722193156.GA30158%40dcvr
In-Reply-To: <28dbe3b0-7a16-1b87-3d59-b8c981fead7c@kdbg.org>

```
Johannes Sixt <j6t@kdbg.org> wrote:
> The previous commit introduced the first use of ENOTSOCK. This macro is
> not available on Windows. Define it as WSAENOTSOCK because that is the
> corresponding error value reported by the Windows versions of socket
> functions.

Thanks.   I thought compat/poll/poll.c already used ENOTSOCK
but I was mislead by the #ifdefs :x

```

## Johannes Schindelin, 2016-07-23 08:02

Subject: Re: [PATCH ew/daemon-socket-keepalive] Windows: add missing definition of ENOTSOCK
Message-ID: <alpine.DEB.2.20.1607230957320.14111@virtualbox>
URL: https://gitlist.dev/e/alpine.DEB.2.20.1607230957320.14111%40virtualbox
In-Reply-To: <xmqqmvl9a2wc.fsf@gitster.mtv.corp.google.com>

```
Hi Junio,

On Fri, 22 Jul 2016, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > On Thu, 21 Jul 2016, Johannes Sixt wrote:
> >
> >> The previous commit introduced the first use of ENOTSOCK. This macro is
> >> not available on Windows. Define it as WSAENOTSOCK because that is the
> >> corresponding error value reported by the Windows versions of socket
> >> functions.
> >
> > Thanks for catching this early.
> 
> (is that an acked/reviewed-by?  it is OK if it is not).

It had been neither, as I had only looked at the patch briefly (which I
deem not enough to account for a review).

However, I now reviewed it properly and offer my Acked-by:.

If it is not too much to ask, I would love to have the following added to
the commit message:

	For details, see
	https://msdn.microsoft.com/en-us/library/windows/desktop/ms740476.aspx

Thanks,
Dscho

```

## Johannes Sixt, 2016-07-23 08:39

Subject: [PATCH v2 ew/daemon-socket-keepalive] Windows: add missing definition of ENOTSOCK
Message-ID: <4ca7ee51-351b-d222-d05a-63c5bdc5c383@kdbg.org>
URL: https://gitlist.dev/e/4ca7ee51-351b-d222-d05a-63c5bdc5c383%40kdbg.org
In-Reply-To: <alpine.DEB.2.20.1607230957320.14111@virtualbox>

```
The previous commit introduced the first use of ENOTSOCK. This macro is
not available on Windows. Define it as WSAENOTSOCK because that is the
corresponding error value reported by the Windows versions of socket
functions.

For details, see
https://msdn.microsoft.com/en-us/library/windows/desktop/ms740476.aspx

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 Same patch text, but the commit message is amended, just in case it's
 easier for you to apply a new patch than to amend a queued one.

 Thanks everybody.

 compat/mingw.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/compat/mingw.h b/compat/mingw.h
index 233933e..95e128f 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -73,6 +73,9 @@ typedef int pid_t;
 #ifndef ECONNABORTED
 #define ECONNABORTED WSAECONNABORTED
 #endif
+#ifndef ENOTSOCK
+#define ENOTSOCK WSAENOTSOCK
+#endif

 struct passwd {
     char *pw_name;
-- 
2.9.0.443.ga8520ad


```
