uds: don't output "Connection refused"

When phc2sys is started before ptp4l or it is interrupted before ptp4l has
a chance to reply to its query, the "uds: sendto failed: Connection refused"
message is output. This is not an interesting message.

Also, don't output the "failed to send message" error from pmc_send, as
all transports output errors in their send routine.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
master
Jiri Benc 2014-05-02 12:37:44 +02:00 committed by Richard Cochran
parent 4df924b253
commit 14742ef566
2 changed files with 4 additions and 8 deletions

View File

@ -143,18 +143,14 @@ static struct ptp_message *pmc_message(struct pmc *pmc, uint8_t action)
static int pmc_send(struct pmc *pmc, struct ptp_message *msg, int pdulen) static int pmc_send(struct pmc *pmc, struct ptp_message *msg, int pdulen)
{ {
int cnt, err; int err;
err = msg_pre_send(msg); err = msg_pre_send(msg);
if (err) { if (err) {
pr_err("msg_pre_send failed"); pr_err("msg_pre_send failed");
return -1; return -1;
} }
cnt = transport_send(pmc->transport, &pmc->fdarray, 0, msg); return transport_send(pmc->transport, &pmc->fdarray, 0, msg);
if (cnt < 0) {
pr_err("failed to send message");
return -1;
}
return 0;
} }
static int pmc_tlv_datalen(struct pmc *pmc, int id) static int pmc_tlv_datalen(struct pmc *pmc, int id)

2
uds.c
View File

@ -111,7 +111,7 @@ static int uds_send(struct transport *t, struct fdarray *fda, int event,
addr = &uds->address; addr = &uds->address;
cnt = sendto(fd, buf, buflen, 0, &addr->sa, addr->len); cnt = sendto(fd, buf, buflen, 0, &addr->sa, addr->len);
if (cnt <= 0) { if (cnt <= 0 && errno != ECONNREFUSED) {
pr_err("uds: sendto failed: %m"); pr_err("uds: sendto failed: %m");
} }
return cnt; return cnt;