• Tycho Andersen's avatar
    util: don't chop off last element in buffer · 3b02df57
    Tycho Andersen authored
    377763e5 is incorrect since we can't always chop off the last element in
    the buffer:
    
    Execute static/cgroup00
    ./cgroup00 --pidfile=cgroup00.pid --outfile=cgroup00.out --dirname=cgroup00.test
    Dump 12819
    (00.003514) Error (files-reg.c:624): Can't create link remap for /dev/nul. Use link-remap option.
    (00.003523) Error (cr-dump.c:1257): Dump files (pid: 12819) failed with -1
    (00.004042) Error (cr-dump.c:1619): Dumping FAILED.
    WARNING: cgroup00 returned 1 and left running for debug needs
    Test: zdtm/live/static/cgroup00, Result: FAIL
    ==================================== ERROR ====================================
    Test: zdtm/live/static/cgroup00, Namespace:
    ================================= ERROR OVER =================================
    
    Hopefully the >= will appease coverity (instead of just a ==).
    Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    3b02df57
util.c 15.3 KB