git/list[1] front-page[2] threads[3] people[4] search[5] about
 

win32-daemon breakage when merged to pu

From
Erik Faye-Lund <kusmabite@gmail.com>
Date
Nov 9, 2010, 10:32 UTC
Message-ID
<AANLkTikXv8BhW-fz=pZ5iS6rHJB5mxMUhk0KFO3JSwWv@mail.gmail.com>

The last commit in 'ef/mingw-daemon' (a666b47) builds just fine for me, but the commit merging it (683df47: "Merge branch 'ef/mingw-daemon' into pu") does not:

$ make
    CC daemon.o
daemon.c: In function 'service_loop':
daemon.c:885: error: invalid application of 'sizeof' to incomplete type 'struct
pollfd'
daemon.c:888: error: invalid use of undefined type 'struct pollfd'
daemon.c:888: error: dereferencing pointer to incomplete type
daemon.c:889: error: invalid use of undefined type 'struct pollfd'
daemon.c:889: error: dereferencing pointer to incomplete type
daemon.c:889: error: 'POLLIN' undeclared (first use in this function)
daemon.c:889: error: (Each undeclared identifier is reported only once
daemon.c:889: error: for each function it appears in.)
daemon.c:899: warning: implicit declaration of function 'poll'
daemon.c:909: error: invalid use of undefined type 'struct pollfd'
daemon.c:909: error: dereferencing pointer to incomplete type
daemon.c:918: error: invalid use of undefined type 'struct pollfd'
daemon.c:918: error: dereferencing pointer to incomplete type
make: *** [daemon.o] Error 1

This is because the merge-commit (683df47) moves the inclusion of <sys/poll.h> inside the "#ifndef __MINGW32__"-block, effectively undoing part of fdc1211 ("mingw: use poll-emulation from gnulib").

I'm guessing this is because of a conflict with 2844923 ("add support for the SUA layer (interix; windows)").

I supposed the correct conflict-resolution would be to keep Markus' new conditional inclusion, but move it to the location I changed it to. With this patch on top it compiles just fine for me:

diff --git a/git-compat-util.h b/git-compat-util.h
index 652e9b5..490f969 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -105,13 +105,13 @@
 #include <regex.h>
 #include <utime.h>
 #include <syslog.h>
-#ifndef __MINGW32__
-#include <sys/wait.h>
 #ifndef NO_SYS_POLL_H
 #include <sys/poll.h>
 #else
 #include <poll.h>
 #endif
+#ifndef __MINGW32__
+#include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <termios.h>
Next: Junio C Hamano
Message 1 of 2 in “win32-daemon breakage when merged to pu”
  1. Erik Faye-LundNov 9, 2010
  2. Junio C HamanoNov 9, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.