summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-01-31 23:32:37 +0800
committerruki <[email protected]>2020-01-31 15:15:47 +0800
commit1278352ff02dcbb52c5a866c3b477581c1c4eebc (patch)
tree1eebb8c36fe6af08d3a0fda12f099381270a5d84
parent20c8823da8a5bde7de52479d7c504a6bde8a23fb (diff)
fix pipe open and openpair
-rwxr-xr-xcore/src/tbox/inc/linux/tbox.config.h3
-rwxr-xr-xcore/src/tbox/inc/macosx/tbox.config.h3
-rw-r--r--xmake/core/base/pipe.lua5
3 files changed, 9 insertions, 2 deletions
diff --git a/core/src/tbox/inc/linux/tbox.config.h b/core/src/tbox/inc/linux/tbox.config.h
index e0b677041..dff3a0dad 100755
--- a/core/src/tbox/inc/linux/tbox.config.h
+++ b/core/src/tbox/inc/linux/tbox.config.h
@@ -189,6 +189,9 @@
#define TB_CONFIG_POSIX_HAVE_GETHOSTBYNAME 1
#define TB_CONFIG_POSIX_HAVE_GETHOSTBYADDR 1
#define TB_CONFIG_POSIX_HAVE_FCNTL 1
+#define TB_CONFIG_POSIX_HAVE_PIPE 1
+/* #undef TB_CONFIG_POSIX_HAVE_PIPE2 */
+#define TB_CONFIG_POSIX_HAVE_MKFIFO 1
// freebsd functions
#define TB_CONFIG_FREEBSD_HAVE_FLOCK 1
diff --git a/core/src/tbox/inc/macosx/tbox.config.h b/core/src/tbox/inc/macosx/tbox.config.h
index 12f545d27..e7f5d15d1 100755
--- a/core/src/tbox/inc/macosx/tbox.config.h
+++ b/core/src/tbox/inc/macosx/tbox.config.h
@@ -177,6 +177,9 @@
#define TB_CONFIG_POSIX_HAVE_GETHOSTBYNAME 1
#define TB_CONFIG_POSIX_HAVE_GETHOSTBYADDR 1
#define TB_CONFIG_POSIX_HAVE_FCNTL 1
+#define TB_CONFIG_POSIX_HAVE_PIPE 1
+/* #undef TB_CONFIG_POSIX_HAVE_PIPE2 */
+#define TB_CONFIG_POSIX_HAVE_MKFIFO 1
// freebsd functions
#define TB_CONFIG_FREEBSD_HAVE_FLOCK 1
diff --git a/xmake/core/base/pipe.lua b/xmake/core/base/pipe.lua
index 57797a46b..d99b8bcb4 100644
--- a/xmake/core/base/pipe.lua
+++ b/xmake/core/base/pipe.lua
@@ -289,9 +289,10 @@ end
--
function pipe.open(name, mode, buffsize)
+ -- open named pipe
local pipefile, errors = io.pipe_open(name, mode, buffsize or 0)
if pipefile then
- return _pipe.new(pipefile, name)
+ return _instance.new(pipefile, name)
else
return nil, string.format("failed to open pipe: %s, error: %s", name, errors or "unknown")
end
@@ -308,7 +309,7 @@ function pipe.openpair(buffsize)
-- open anonymous pipe pair
local rpipefile, wpipefile, errors = io.pipe_openpair(buffsize or 0)
if rpipefile and wpipefile then
- return _pipe.new(rpipefile), _pipe.new(wpipefile)
+ return _instance.new(rpipefile), _instance.new(wpipefile)
else
return nil, nil, string.format("failed to open anonymous pipe pair, error: %s", errors or "unknown")
end