diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1999-02-03 02:55:59 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1999-02-03 02:55:59 +0000 |
commit | d0c2c187633fa906eee672c21f46a2ac68148d15 (patch) | |
tree | fc51a3d3a52c16d7edc82f1a388f4107ea238d95 /socket.c | |
parent | b7406a23e1b4e9279e7bffd88352a20574a45f62 (diff) | |
download | fetchmail-d0c2c187633fa906eee672c21f46a2ac68148d15.tar.gz fetchmail-d0c2c187633fa906eee672c21f46a2ac68148d15.tar.bz2 fetchmail-d0c2c187633fa906eee672c21f46a2ac68148d15.zip |
Simplify error reporting further.
svn path=/trunk/; revision=2374
Diffstat (limited to 'socket.c')
-rw-r--r-- | socket.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -52,13 +52,13 @@ static int handle_plugin(const char *host, int fds[2]; if (socketpair(AF_UNIX,SOCK_STREAM,0,fds)) { - report(stderr, errno, _("fetchmail: socketpair failed\n")); + report(stderr, _("fetchmail: socketpair failed\n")); return -1; } switch (fork()) { case -1: /* error */ - report(stderr, errno, _("fetchmail: fork failed\n")); + report(stderr, _("fetchmail: fork failed\n")); return -1; break; case 0: /* child */ @@ -66,15 +66,15 @@ static int handle_plugin(const char *host, ** detection */ (void) close(fds[1]); if ( (dup2(fds[0],0) == -1) || (dup2(fds[0],1) == -1) ) { - report(stderr, errno, _("dup2 failed\n")); + report(stderr, _("dup2 failed\n")); exit(1); } /* fds[0] is now connected to 0 and 1; close it */ (void) close(fds[0]); if (outlevel >= O_VERBOSE) - report(stderr, 0, _("running %s %s %s\n"), plugin, host, service); + report(stderr, _("running %s %s %s\n"), plugin, host, service); execlp(plugin,plugin,host,service,0); - report(stderr, errno, _("execl(%s) failed\n"), plugin); + report(stderr, _("execl(%s) failed\n"), plugin); exit(0); break; default: /* parent */ @@ -91,7 +91,6 @@ static int handle_plugin(const char *host, int SockOpen(const char *host, const char *service, const char *options, const char *plugin) { - int i; struct addrinfo *ai, req; #if NET_SECURITY void *request = NULL; @@ -105,8 +104,8 @@ int SockOpen(const char *host, const char *service, const char *options, memset(&req, 0, sizeof(struct addrinfo)); req.ai_socktype = SOCK_STREAM; - if (i = getaddrinfo(host, service, &req, &ai)) { - report(stderr, i, _("fetchmail: getaddrinfo(%s.%s)\n"), host,service); + if (getaddrinfo(host, service, &req, &ai)) { + report(stderr, _("fetchmail: getaddrinfo(%s.%s)\n"), host,service); return -1; }; @@ -186,7 +185,7 @@ int SockOpen(const char *host, int clientPort, const char *options, if(hp->h_length != 4 && hp->h_length != 8) { h_errno = errno = 0; - report(stderr, 0, + report(stderr, _("fetchmail: illegal address length received for host %s\n"),host); return -1; } |