All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH il/rfc-remote-fd-ext] Fix build on Windows
@ 2010-08-13 22:09 Johannes Sixt
  2010-08-14  9:38 ` Ilari Liusvaara
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Sixt @ 2010-08-13 22:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Ilari Liusvaara, git

This adds the necessary #defines so that the programs can be built, but
since the poll emulation is not extended to support POLLOUT and POLLNVAL,
the resulting programs will most likely not function properly. (The test
does not check them, yet.)

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

diff --git a/compat/mingw.h b/compat/mingw.h
index 3b2477b..f27a7b6 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -23,6 +23,9 @@ typedef int pid_t;
 #define WEXITSTATUS(x) ((x) & 0xff)
 #define WTERMSIG(x) SIGTERM
 
+#define EWOULDBLOCK EAGAIN
+#define SHUT_WR SD_SEND
+
 #define SIGHUP 1
 #define SIGQUIT 3
 #define SIGKILL 9
@@ -50,6 +53,8 @@ struct pollfd {
 };
 #define POLLIN 1
 #define POLLHUP 2
+#define POLLOUT 4
+#define POLLNVAL 8
 #endif
 
 typedef void (__cdecl *sig_handler_t)(int);
-- 
1.7.1.402.gf1eeb

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH il/rfc-remote-fd-ext] Fix build on Windows
  2010-08-13 22:09 [PATCH il/rfc-remote-fd-ext] Fix build on Windows Johannes Sixt
@ 2010-08-14  9:38 ` Ilari Liusvaara
  2010-08-14 18:31   ` Johannes Sixt
  0 siblings, 1 reply; 3+ messages in thread
From: Ilari Liusvaara @ 2010-08-14  9:38 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Junio C Hamano, git

On Sat, Aug 14, 2010 at 12:09:19AM +0200, Johannes Sixt wrote:
> This adds the necessary #defines so that the programs can be built, but
> since the poll emulation is not extended to support POLLOUT and POLLNVAL,
> the resulting programs will most likely not function properly. (The test
> does not check them, yet.)

The code doesn't really need POLLNVAL (Its just there for "can't happen"
case). POLLOUT is needed. I looked at poll emulation code: It returning
EINVAL causes transfer loop to fail quick.

I think its possible to write the loop in terms of select instead of poll.
Would this be better for Git on Windows?

-Ilari

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH il/rfc-remote-fd-ext] Fix build on Windows
  2010-08-14  9:38 ` Ilari Liusvaara
@ 2010-08-14 18:31   ` Johannes Sixt
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Sixt @ 2010-08-14 18:31 UTC (permalink / raw)
  To: Ilari Liusvaara; +Cc: Junio C Hamano, git

On Samstag, 14. August 2010, Ilari Liusvaara wrote:
> The code doesn't really need POLLNVAL (Its just there for "can't happen"
> case). POLLOUT is needed. I looked at poll emulation code: It returning
> EINVAL causes transfer loop to fail quick.
>
> I think its possible to write the loop in terms of select instead of poll.
> Would this be better for Git on Windows?

No. select does not work with pipes on Windows.

-- Hannes

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-14 18:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-13 22:09 [PATCH il/rfc-remote-fd-ext] Fix build on Windows Johannes Sixt
2010-08-14  9:38 ` Ilari Liusvaara
2010-08-14 18:31   ` Johannes Sixt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.