ソースを参照

compat: Fix pipe compat function

The compatibility function was never built since we were forcing
HAVE_PIPE in compat.h
Hugo Beauzée-Luyssen 6 年 前
コミット
e9849895ae
3 ファイル変更6 行追加13 行削除
  1. 1 1
      Makefile.am
  2. 0 11
      compat/compat.c
  3. 5 1
      compat/compat.h

+ 1 - 1
Makefile.am

@@ -88,7 +88,7 @@ libdsm_la_SOURCES = \
     src/smb_utils.c
 
 noinst_LTLIBRARIES = libcompat.la
-libcompat_la_SOURCES = compat/compat.c
+libcompat_la_SOURCES = 
 libcompat_la_LIBADD = $(LTLIBOBJS)
 
 pkgconfigdir = $(libdir)/pkgconfig

+ 0 - 11
compat/compat.c

@@ -1,11 +0,0 @@
-#include "config.h"
-
-#if !defined(HAVE_PIPE) && defined(HAVE__PIPE)
-
-#include <fcntl.h>
-
-int pipe(int fds[2])
-{
-    return _pipe(fds, 32768, O_NOINHERIT | O_BINARY);
-}
-#endif

+ 5 - 1
compat/compat.h

@@ -66,8 +66,12 @@ char *strndup(const char *str, size_t n);
 #endif
 
 #if !defined(HAVE_PIPE) && defined(HAVE__PIPE)
+#include <fcntl.h>
 #define HAVE_PIPE
-int pipe(int fds[2]);
+static inline int pipe(int fds[2])
+{
+    return _pipe(fds, 32768, O_NOINHERIT | O_BINARY);
+}
 #endif
 
 #ifndef _WIN32