From 4b1b3bf6c62f8208b2eea506c9dac1504df6e916 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 8 Dec 2015 12:17:22 +0100 Subject: erts: Never abort in the forked child We always want the error to propagate up to the application when a child cannot be created. --- erts/emulator/sys/unix/erl_child_setup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'erts') diff --git a/erts/emulator/sys/unix/erl_child_setup.c b/erts/emulator/sys/unix/erl_child_setup.c index 94d1fd64c7..4e61530cf1 100644 --- a/erts/emulator/sys/unix/erl_child_setup.c +++ b/erts/emulator/sys/unix/erl_child_setup.c @@ -136,7 +136,7 @@ start_new_child(int pipes[]) } while(res < 0 && (errno == EINTR || errno == ERRNO_BLOCK)); if (res <= 0) { - ABORT("Failed to read size from %d (%d)", pipes[0], errno); + goto child_error; } buff = malloc(size); @@ -147,8 +147,7 @@ start_new_child(int pipes[]) if ((res = read(pipes[0], buff + pos, size - pos)) < 0) { if (errno == ERRNO_BLOCK || errno == EINTR) continue; - ABORT("Failed to read %d bytes from %d (%d,%d)", - size, pipes[0], res, errno); + goto child_error; } if (res == 0) { errno = EPIPE; @@ -200,7 +199,8 @@ start_new_child(int pipes[]) } if (o_buff + size != buff) { - ABORT("Buff error: %p, %p:%p", o_buff, o_buff+size, buff); + errno = EINVAL; + goto child_error; } DEBUG_PRINT("read ack"); -- cgit v1.2.3