aboutgitcodebugslistschat
path: root/flow.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2024-07-24 16:36:17 +0200
committerStefano Brivio <sbrivio@redhat.com>2024-07-25 12:25:31 +0200
commit1cd773081f12af86b5b1ce66842c20fb6f734521 (patch)
treeeacd6dc608fac48cddc1fe2bebfc30477b26f5d9 /flow.c
parent13295583f8b64b67030aa8ef8d568adc451fcd8c (diff)
downloadpasst-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 'flow.c')
-rw-r--r--flow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/flow.c b/flow.c
index d7d548d..bd5fa2b 100644
--- a/flow.c
+++ b/flow.c
@@ -279,7 +279,7 @@ void flow_log_(const struct flow_common *f, int pri, const char *fmt, ...)
else
type_or_state = FLOW_TYPE(f);
- logmsg(pri, "Flow %u (%s): %s", flow_idx(f), type_or_state, msg);
+ logmsg(true, pri, "Flow %u (%s): %s", flow_idx(f), type_or_state, msg);
}
/**