threads / patch / 42902

patchWindows: add missing definition of ENOTSOCK

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

## tl;dr

6 messages between Jul 21, 2016 and Jul 23, 2016. Diffs are folded; open one to read it.

replies: 5people: 4as markdown or json

Johannes Sixt· Jul 21, 2016, 20:59 UTC · lore

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(+)
Show changes to compat/mingw.h +3 −0
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· Jul 22, 2016, 08:21 UTC · re: Johannes Sixt · lore

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

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· Jul 22, 2016, 19:28 UTC · re: Johannes Schindelin · lore

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

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 10 quoted lines
> 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.
Johannes Schindelin· Jul 23, 2016, 08:02 UTC · re: Junio C Hamano · lore

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

Hi Junio,
On Fri, 22 Jul 2016, Junio C Hamano wrote:
Show 12 quoted lines
> 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· Jul 23, 2016, 08:39 UTC · re: Johannes Schindelin · lore

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

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(+)
Show changes to compat/mingw.h +3 −0
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
Eric Wong· Jul 22, 2016, 19:31 UTC · re: Johannes Sixt · lore

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

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

← back to recent threads