Merge branch 'ew/daemon-socket-keepalive' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 8 Aug 2016 21:21:37 +0000 (14:21 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Aug 2016 21:21:37 +0000 (14:21 -0700)
Recent update to "git daemon" tries to enable the socket-level
KEEPALIVE, but when it is spawned via inetd, the standard input
file descriptor may not necessarily be connected to a socket.
Suppress an ENOTSOCK error from setsockopt().

* ew/daemon-socket-keepalive:
Windows: add missing definition of ENOTSOCK
daemon: ignore ENOTSOCK from setsockopt

1  2 
compat/mingw.h
diff --combined compat/mingw.h
index 9a8803b876a1ed38aca34e83c3859e607bdd17e7,7489d2980e751f62badd6d92a40625c6023f9f76..ef22cbb05d140a210bd348ea1234fc60cdf09da8
@@@ -73,6 -73,9 +73,9 @@@ typedef int pid_t
  #ifndef ECONNABORTED
  #define ECONNABORTED WSAECONNABORTED
  #endif
+ #ifndef ENOTSOCK
+ #define ENOTSOCK WSAENOTSOCK
+ #endif
  
  struct passwd {
        char *pw_name;
@@@ -142,7 -145,6 +145,7 @@@ static inline int fcntl(int fd, int cmd
  #define sigemptyset(x) (void)0
  static inline int sigaddset(sigset_t *set, int signum)
  { return 0; }
 +#define SIG_BLOCK 0
  #define SIG_UNBLOCK 0
  static inline int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
  { return 0; }
@@@ -407,7 -409,7 +410,7 @@@ static inline void convert_slashes(cha
  int mingw_offset_1st_component(const char *path);
  #define offset_1st_component mingw_offset_1st_component
  #define PATH_SEP ';'
 -#ifndef __MINGW64_VERSION_MAJOR
 +#if !defined(__MINGW64_VERSION_MAJOR) && (!defined(_MSC_VER) || _MSC_VER < 1800)
  #define PRIuMAX "I64u"
  #define PRId64 "I64d"
  #else
  void mingw_open_html(const char *path);
  #define open_html mingw_open_html
  
 -void mingw_mark_as_git_dir(const char *dir);
 -#define mark_as_git_dir mingw_mark_as_git_dir
 -
  /**
   * Converts UTF-8 encoded string to UTF-16LE.
   *
@@@ -532,8 -537,8 +535,8 @@@ extern CRITICAL_SECTION pinfo_cs
   * A replacement of main() that adds win32 specific initialization.
   */
  
 -void mingw_startup();
 -#define main(c,v) dummy_decl_mingw_main(); \
 +void mingw_startup(void);
 +#define main(c,v) dummy_decl_mingw_main(void); \
  static int mingw_main(c,v); \
  int main(int argc, char **argv) \
  { \