Skip to content

Commit b365f94

Browse files
committed
Removed pipe2, because of compilation error.
1 parent cedacf4 commit b365f94

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

asynctools/asyncpipe.nim

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ else:
117117
when defined(windows):
118118
import winlean
119119
else:
120-
when defined(linux):
121-
import linux
122120
import posix
123121

124122
type
@@ -333,16 +331,10 @@ else:
333331

334332
proc createPipe*(size = 65536, register = true): AsyncPipe =
335333
var fds: array[2, cint]
336-
when defined(linux):
337-
# pipe2 syscall was added in 2.6.27, it allows to create atomically set
338-
# the O_NONBLOCK flag.
339-
if linux.pipe2(fds, O_NONBLOCK) == -1:
340-
raiseOSError(osLastError())
341-
else:
342-
if posix.pipe(fds) == -1:
343-
raiseOSError(osLastError())
344-
setNonBlocking(fds[0])
345-
setNonBlocking(fds[1])
334+
if posix.pipe(fds) == -1:
335+
raiseOSError(osLastError())
336+
setNonBlocking(fds[0])
337+
setNonBlocking(fds[1])
346338

347339
result = AsyncPipe(readPipe: fds[0], writePipe: fds[1])
348340

0 commit comments

Comments
 (0)