浏览代码

Fallback on _pipe when it is available

Hugo Beauzée-Luyssen 9 年之前
父节点
当前提交
08e4bca292
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 1 1
      configure.ac
  2. 3 0
      src/netbios_ns.c

+ 1 - 1
configure.ac

@@ -99,7 +99,7 @@ AC_CHECK_DECLS([CLOCK_MONOTONIC],,,[
 AC_REPLACE_FUNCS([strlcpy])
 AC_REPLACE_FUNCS([strndup])
 AC_REPLACE_FUNCS([clock_gettime])
-AC_CHECK_FUNCS([pipe])
+AC_CHECK_FUNCS([pipe _pipe])
 
 AC_CHECK_HEADERS([bsd/string.h langinfo.h alloca.h sys/queue.h arpa/inet.h sys/socket.h])
 

+ 3 - 0
src/netbios_ns.c

@@ -156,10 +156,13 @@ error:
 }
 
 #ifndef HAVE_PIPE
+#ifdef HAVE__PIPE
 static inline int pipe(int fds[2])
 {
     return _pipe(fds, 32768, O_NOINHERIT | O_BINARY);
 }
+#define HAVE_PIPE
+#endif
 #endif
 
 static int    ns_open_abort_pipe(netbios_ns *ns)