diff options
author | Sverker Eriksson <[email protected]> | 2016-08-10 15:24:30 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-08-10 15:24:30 +0200 |
commit | 7f86a0fedf5a18d82817ceb530aae0f8167c9354 (patch) | |
tree | 29ce1d7b2e83653480559b87bca4d40c550f4e9e /erts/etc | |
parent | acf0330b0f5b1f4b8fc411cac45f57348b459525 (diff) | |
download | otp-7f86a0fedf5a18d82817ceb530aae0f8167c9354.tar.gz otp-7f86a0fedf5a18d82817ceb530aae0f8167c9354.tar.bz2 otp-7f86a0fedf5a18d82817ceb530aae0f8167c9354.zip |
run_erl: Add sleepy_child test case
with run_erl option -sleepy-child
to provoke race when slave pty is late
Diffstat (limited to 'erts/etc')
-rw-r--r-- | erts/etc/unix/run_erl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/erts/etc/unix/run_erl.c b/erts/etc/unix/run_erl.c index f8b5da47ab..6a92e18648 100644 --- a/erts/etc/unix/run_erl.c +++ b/erts/etc/unix/run_erl.c @@ -240,6 +240,7 @@ int main(int argc, char **argv) int off_argv; int calculated_pipename = 0; int highest_pipe_num = 0; + int sleepy_child = 0; program_name = argv[0]; @@ -250,6 +251,11 @@ int main(int argc, char **argv) init_outbuf(); + if (!strcmp(argv[1],"-sleepy-child")) { /* For test purpose only */ + sleepy_child = 1; + ++i; + } + if (!strcmp(argv[1],"-daemon")) { daemon_init(); ++i; @@ -392,6 +398,9 @@ int main(int argc, char **argv) exit(1); } if (childpid == 0) { + if (sleepy_child) + sleep(1); + /* Child */ sf_close(mfd); /* disassociate from control terminal */ |