diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-03-12 11:16:36 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-03-12 11:16:36 +0100 |
commit | 4e707e7a5fc1507c360bc174ef3decadba6bfa9b (patch) | |
tree | 09924efee7ec2e9c32ed8375c153d6e4f4f033a9 /econserv.c | |
parent | 5892da74df3ab49b23066465fef286c451eed389 (diff) | |
download | econ-4e707e7a5fc1507c360bc174ef3decadba6bfa9b.tar.gz econ-4e707e7a5fc1507c360bc174ef3decadba6bfa9b.tar.bz2 econ-4e707e7a5fc1507c360bc174ef3decadba6bfa9b.zip |
Use perror where possible
Diffstat (limited to 'econserv.c')
-rw-r--r-- | econserv.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -27,7 +27,6 @@ #include <stddef.h> #include <stdint.h> #include <assert.h> -#include <errno.h> #include <sys/types.h> #include <sys/socket.h> @@ -212,7 +211,7 @@ handle_input(struct ecs *ecs, char *in, int fd, in.sin_addr.s_addr = ((struct sockaddr_in *) src_addr)->sin_addr.s_addr; printf("got connect request\n"); if (connect(ecs->client_fd, (struct sockaddr *) &in, sizeof in) != 0) { - fprintf(stderr, "failed to connect: %s\n", strerror(errno)); + perror("Failed to connect"); close(ecs->client_fd); ecs->client_fd = -1; ecs->state = E_PSTAT_NOUSE; @@ -347,7 +346,7 @@ int main(int argc, char *argv[]) } if (select(maxfd + 1, &fds, NULL, NULL, NULL) <= 0) { - fprintf(stderr, "select failed: %s", strerror(errno)); + perror("Select failed"); continue; } |