summaryrefslogtreecommitdiffstats
path: root/sockutil.c
diff options
context:
space:
mode:
authorNathan Straz <nstraz@redhat.com>2013-09-19 15:43:06 -0400
committerNathan Straz <nstraz@redhat.com>2013-09-19 15:43:06 -0400
commit879838a0b5c395d7bef759b9d76eadefbe21d4c7 (patch)
treec3f857cddab0d8167579573cf559a6a312e4d3b1 /sockutil.c
parent9a5d808f7143d16bc5d7800271cfa78f666de111 (diff)
downloadqarsh-879838a0b5c395d7bef759b9d76eadefbe21d4c7.tar.gz
qarsh-879838a0b5c395d7bef759b9d76eadefbe21d4c7.tar.xz
qarsh-879838a0b5c395d7bef759b9d76eadefbe21d4c7.zip
Add reasonable log priorities
Diffstat (limited to 'sockutil.c')
-rw-r--r--sockutil.c8
1 files changed, 4 insertions, 4 deletions
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;