Skip to content

Commit 20c681a

Browse files
committed
Fix process_create mode, re issue #971
1 parent b588a2c commit 20c681a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/bif_streams.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,7 @@ static bool bif_process_create_3(query *q)
12241224
posix_spawn_file_actions_adddup2(&file_actions, fds[0], 0);
12251225
q->pl->streams[n].fp = fdopen(fds[1], "w");
12261226
q->pl->streams[n].pipe = true;
1227+
checked(q->pl->streams[n].mode = strdup("write"));
12271228
cell tmp;
12281229
make_int(&tmp, n);
12291230
tmp.flags |= FLAG_INT_STREAM;
@@ -1248,6 +1249,7 @@ static bool bif_process_create_3(query *q)
12481249
posix_spawn_file_actions_adddup2(&file_actions, fds[1], 1);
12491250
q->pl->streams[n].fp = fdopen(fds[0], "r");
12501251
q->pl->streams[n].pipe = true;
1252+
checked(q->pl->streams[n].mode = strdup("read"));
12511253
cell tmp;
12521254
make_int(&tmp, n);
12531255
tmp.flags |= FLAG_INT_STREAM;
@@ -1272,6 +1274,7 @@ static bool bif_process_create_3(query *q)
12721274
posix_spawn_file_actions_adddup2(&file_actions, fds[1], 2);
12731275
q->pl->streams[n].fp = fdopen(fds[0], "r");
12741276
q->pl->streams[n].pipe = true;
1277+
checked(q->pl->streams[n].mode = strdup("read"));
12751278
cell tmp;
12761279
make_int(&tmp, n);
12771280
tmp.flags |= FLAG_INT_STREAM;

0 commit comments

Comments
 (0)