From 879838a0b5c395d7bef759b9d76eadefbe21d4c7 Mon Sep 17 00:00:00 2001 From: Nathan Straz Date: Thu, 19 Sep 2013 15:43:06 -0400 Subject: Add reasonable log priorities --- sockutil.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sockutil.c') diff --git a/sockutil.c b/sockutil.c index 9d2da1d..87a718b 100644 --- a/sockutil.c +++ b/sockutil.c @@ -56,7 +56,7 @@ connect_to_host(char *hostname, int port, unsigned short *ss_family) snprintf(portstr, NI_MAXSERV, "%d", port); if ((err = getaddrinfo(hostname, portstr, &hints, &ail)) != 0) { - lprintf(0, "Could not resolve hostname %s: %s\n", + lprintf(LOG_ERR, "Could not resolve hostname %s: %s\n", hostname, gai_strerror(err)); return -1; } @@ -115,7 +115,7 @@ recv_packet(int fd) do { if ((ret = read(fd, (char *)psbuf+bufused, sizeof packetsize - bufused)) < 0) { - lprintf(0, "Read error while reading packet size: %s\n", strerror(errno)); + lprintf(LOG_ERR, "Read error while reading packet size: %s\n", strerror(errno)); return NULL; } else if (ret == 0) { return NULL; @@ -125,14 +125,14 @@ recv_packet(int fd) packetsize = ntohl(packetsize); if (packetsize > QARSH_MAX_PACKET_SIZE) { - lprintf(0, "Packet size too large, %d > %d\n", packetsize, QARSH_MAX_PACKET_SIZE); + lprintf(LOG_ERR, "Packet size too large, %d > %d\n", packetsize, QARSH_MAX_PACKET_SIZE); return NULL; } /* Keep reading until we get the whole packet and nothing but the packet, so help me socket */ bufused = 0; do { if ((ret = read(fd, buf+bufused, packetsize-bufused)) < 0) { - lprintf(0, "Read error while reading packet data: %s\n", strerror(errno)); + lprintf(LOG_ERR, "Read error while reading packet data: %s\n", strerror(errno)); return NULL; } bufused += ret; -- cgit