• Vladimir Davydov's avatar
    zdtm/pty02: never close master before reading slave · 888cae43
    Vladimir Davydov authored
    We may close the master before reading the slave if the child runs first
    when the parent wakes it up using task_waiter_complete. In this case the
    subsequent read from the slave will return 0 resulting in a false
    positive test failure:
    
    13:23:42.194: 30914: ERR: pty02.c:89: read(slave) failed (errno = 11 (Resource temporarily unavailable))
    
    Fix this by waking the child, which closes the master, only after the
    read has been completed.
    
    Also note errno = EAGAIN in the failure report above, which looks really
    confusing. Let's print the actual number of bytes read/written along
    with the errno while reporting a read/write failure to make the error
    reporting clearer in this test.
    Signed-off-by: 's avatarVladimir Davydov <vdavydov@parallels.com>
    Cc: Cyrill Gorcunov <gorcunov@parallels.com>
    Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
    Acked-by: 's avatarCyrill Gorcunov <gorcunov@parallels.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    888cae43
Name
Last commit
Last update
..
app-emu Loading commit data...
bers Loading commit data...
ext-links Loading commit data...
fault-injection Loading commit data...
jenkins Loading commit data...
libcriu Loading commit data...
mem-snap Loading commit data...
mounts Loading commit data...
rpc Loading commit data...
security Loading commit data...
tcp Loading commit data...
unix-callback Loading commit data...
zdtm Loading commit data...
.gitignore Loading commit data...
Makefile Loading commit data...
app-emu.sh Loading commit data...
env.sh Loading commit data...
functions.sh Loading commit data...
maps.py Loading commit data...
post-dump.sh Loading commit data...
zdtm.sh Loading commit data...
zdtm_ct.c Loading commit data...
zdtm_mount_cgroups Loading commit data...