• Kir Kolyshkin's avatar
    pr_perror(): print error at the end of line · 0b237ae9
    Kir Kolyshkin authored
    This is a standard convention to print error message (i.e. strerror(errno))
    at the end of line, like this:
    
            Cannot remove file: Permission denied
    
    So pr_perror is fixed to follow this convention (using GNU extension
    %m helps a lot here). Unfortunately, due to this we have to make
    pr_perror() print a new line character, too, so we had to strip it
    from the all pr_perror() invocations.
    
    That (appending a newline) also makes pr_perror() a black sheep
    in the herd of pr_* helpers, but what can we do? Worst case scenario
    is an extra newline after an error message, not too harmful.
    
    An alternative approach (stripping the newline from the passed format
    string and re-adding it) was discussed thoroughly, and it was decided
    that such a hack looks a bit too dirty.
    Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
    Acked-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    0b237ae9
log.c 1.1 KB