• 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
Documentation Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
include/common Loading commit data...
lib Loading commit data...
scripts Loading commit data...
soccr Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.config Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...