diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2024-07-24 16:36:17 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-07-25 12:25:31 +0200 |
commit | 1cd773081f12af86b5b1ce66842c20fb6f734521 (patch) | |
tree | eacd6dc608fac48cddc1fe2bebfc30477b26f5d9 /test | |
parent | 13295583f8b64b67030aa8ef8d568adc451fcd8c (diff) | |
download | passt-1cd773081f12af86b5b1ce66842c20fb6f734521.tar passt-1cd773081f12af86b5b1ce66842c20fb6f734521.tar.gz passt-1cd773081f12af86b5b1ce66842c20fb6f734521.tar.bz2 passt-1cd773081f12af86b5b1ce66842c20fb6f734521.tar.lz passt-1cd773081f12af86b5b1ce66842c20fb6f734521.tar.xz passt-1cd773081f12af86b5b1ce66842c20fb6f734521.tar.zst passt-1cd773081f12af86b5b1ce66842c20fb6f734521.zip |
log: Drop newlines in the middle of the perror()-like messages
Calling vlogmsg() twice from logmsg_perror() results in this beauty:
$ ./pasta -i foo
Invalid interface name foo
: No such device
because the first part of the message, corresponding to the first
call, doesn't end with a newline, and vlogmsg() adds it.
Given that we can't easily append an argument (error description) to
a variadic list, add a 'newline' parameter to all the functions that
currently add a newline if missing, and disable that on the first call
to vlogmsg() from logmsg_perror(). Not very pretty but I can't think
of any solution that's less messy than this.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions