diff options
author | Lukas Larsson <[email protected]> | 2015-12-08 12:17:22 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2015-12-15 10:05:48 +0100 |
commit | 4b1b3bf6c62f8208b2eea506c9dac1504df6e916 (patch) | |
tree | 48466d02989125901ebbcdb2c6624fac9542dfab | |
parent | 10ffa0b2f8c66b3a318503b4dfdfe02d6577d746 (diff) | |
download | otp-4b1b3bf6c62f8208b2eea506c9dac1504df6e916.tar.gz otp-4b1b3bf6c62f8208b2eea506c9dac1504df6e916.tar.bz2 otp-4b1b3bf6c62f8208b2eea506c9dac1504df6e916.zip |
erts: Never abort in the forked child
We always want the error to propagate up to the application
when a child cannot be created.
-rw-r--r-- | erts/emulator/sys/unix/erl_child_setup.c | 8 |
1 files changed, 4 insertions, 4 deletions
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"); |