diff options
author | Sverker Eriksson <[email protected]> | 2016-07-07 11:34:13 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-07-07 11:34:13 +0200 |
commit | 4cf0d172b61b06f8b5c2765da7e134c2b912c492 (patch) | |
tree | 9c04574bfab3c2a5a27f70a42a6c6323984a7522 /erts/emulator/sys | |
parent | 269dae49056d29c65add089deffebf27b86980c3 (diff) | |
parent | 9026aeebb86396e850a8f6347d1a81f9e2db5918 (diff) | |
download | otp-4cf0d172b61b06f8b5c2765da7e134c2b912c492.tar.gz otp-4cf0d172b61b06f8b5c2765da7e134c2b912c492.tar.bz2 otp-4cf0d172b61b06f8b5c2765da7e134c2b912c492.zip |
Merge branch 'maint'
Diffstat (limited to 'erts/emulator/sys')
-rw-r--r-- | erts/emulator/sys/unix/sys_drivers.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/erts/emulator/sys/unix/sys_drivers.c b/erts/emulator/sys/unix/sys_drivers.c index 812112fb91..3d7be020e1 100644 --- a/erts/emulator/sys/unix/sys_drivers.c +++ b/erts/emulator/sys/unix/sys_drivers.c @@ -688,6 +688,10 @@ static ErlDrvData spawn_start(ErlDrvPort port_num, char* name, return ERL_DRV_ERROR_ERRNO; } + /* + * Whitebox test port_SUITE:pipe_limit_env + * assumes this command payload format. + */ io_vector[i].iov_base = (void*)&buffsz; io_vector[i++].iov_len = sizeof(buffsz); @@ -765,9 +769,14 @@ static ErlDrvData spawn_start(ErlDrvPort port_num, char* name, if (res < (buffsz + sizeof(buffsz))) { /* we only wrote part of the command payload. Enqueue the rest. */ for (i = 0; i < iov_len; i++) { - driver_enq(port_num, io_vector[i].iov_base, io_vector[i].iov_len); + if (res >= io_vector[i].iov_len) + res -= io_vector[i].iov_len; + else { + driver_enq(port_num, io_vector[i].iov_base + res, + io_vector[i].iov_len - res); + res = 0; + } } - driver_deq(port_num, res); driver_select(port_num, ofd[1], ERL_DRV_WRITE|ERL_DRV_USE, 1); } |