From 4df58f30592c96ebe47885810b8535de71b4f09e Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Sat, 11 May 2019 09:22:29 -0700 Subject: [PATCH] fix warning in statsd_client about %m gnu only printf special char --- third_party/statsd-client-cpp/src/statsd_client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/statsd-client-cpp/src/statsd_client.cpp b/third_party/statsd-client-cpp/src/statsd_client.cpp index ca39e865..b4641d95 100644 --- a/third_party/statsd-client-cpp/src/statsd_client.cpp +++ b/third_party/statsd-client-cpp/src/statsd_client.cpp @@ -108,7 +108,7 @@ int StatsdClient::init() d->sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if ( d->sock == -1 ) { - snprintf(d->errmsg, sizeof(d->errmsg), "could not create socket, err=%m"); + snprintf(d->errmsg, sizeof(d->errmsg), "could not create socket, err=%s", strerror(errno)); return -1; } @@ -229,7 +229,7 @@ int StatsdClient::send_to_daemon(const string &message) { ret = (int) sendto(d->sock, message.data(), message.size(), 0, (struct sockaddr *) &d->server, sizeof(d->server)); if ( ret == -1) { snprintf(d->errmsg, sizeof(d->errmsg), - "sendto server fail, host=%s:%d, err=%m", d->host.c_str(), d->port); + "sendto server fail, host=%s:%d, err=%s", d->host.c_str(), d->port, strerror(errno)); return -1; }