Skip to content

Commit c4ef888

Browse files
Copilotenghitalo
andcommitted
Fix Windows pipe creation in notify tests
Co-authored-by: enghitalo <63821277+enghitalo@users.noreply.github.com>
1 parent 6f3b4d5 commit c4ef888

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

vlib/os/notify/notify_test.c.v

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@
33
import os
44
import os.notify
55

6+
fn C._pipe(&int, u32, int) int
7+
68
// make a pipe and return the (read, write) file descriptors
79
fn make_pipe() !(int, int) {
810
pipefd := [2]int{}
9-
if C.pipe(&pipefd[0]) != 0 {
10-
return error('error ${C.errno}: ' + os.posix_get_error_msg(C.errno))
11+
$if windows {
12+
if C._pipe(&pipefd[0], 256, 0) != 0 {
13+
return error('error ${C.errno}: Failed to create pipe')
14+
}
15+
} $else {
16+
if C.pipe(&pipefd[0]) != 0 {
17+
return error('error ${C.errno}: ' + os.posix_get_error_msg(C.errno))
18+
}
1119
}
1220
return pipefd[0], pipefd[1]
1321
}

0 commit comments

Comments
 (0)