• Vitaly Ostrosablin's avatar
    test: replace cat in Makefiles with awk · 911317ea
    Vitaly Ostrosablin authored
    cat *.pid works when we have only one running process at any moment.
    That's because pidfiles contain no newlines and cat will just
    concatenate content of all files present in directory. So, e.g., if we
    have pidfiles:
    
    31338
    31359
    31880
    31884
    31889
    
    cat will build following string from those pidfiles:
    
    3133831359318803188431889
    
    Obviously, kill would fail to send signals to processes, because it's
    now a single big number, which cannot be unambigously split back in
    general case.
    
    That's where awk comes in. We don't need to modify C part of tests to
    print newlines at end of file. We just order awk to print content of
    each file, which adds a newline at end - problem solved, kill can once
    again parse, which PIDs it get and send proper signals to them. Also,
    should be completely safe for zdtm.py, because it doesn't use Makefiles
    and sends signals on it's own.
    
    travis-ci: success for series starting with [v2,1/2] test: replace cat in Makefiles with awk
    Signed-off-by: 's avatarVitaly Ostrosablin <vostrosablin@virtuozzo.com>
    Reviewed-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    Reviewed-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
    Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    911317ea
Name
Last commit
Last update
..
Makefile Loading commit data...
epoll.c Loading commit data...
fifo_dyn.c Loading commit data...
fifo_dyn.desc Loading commit data...
fifo_loop.c Loading commit data...
file_aio.c Loading commit data...
file_read.c Loading commit data...
fork.c Loading commit data...
fork2.c Loading commit data...
ipc.c Loading commit data...
ipc.desc Loading commit data...
maps007.c Loading commit data...
maps007.desc Loading commit data...
maps008.c Loading commit data...
maps008.desc Loading commit data...
netlink00.c Loading commit data...
netlink00.desc Loading commit data...
pipe_loop00.c Loading commit data...
pipe_shared00.c Loading commit data...
ptrace.c Loading commit data...
ptrace.desc Loading commit data...
shmem.c Loading commit data...
socket-tcp.c Loading commit data...
socket-tcp.desc Loading commit data...
socket-tcp6.c Loading commit data...
socket-tcp6.desc Loading commit data...
socket_loop00.c Loading commit data...
thread-bomb.c Loading commit data...
thread-bomb.desc Loading commit data...
unix_sock.c Loading commit data...