aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-12-15 16:17:21 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-12-15 16:17:21 +0000
commitf50d39cc0c9f8487dde51788940bbce975a43503 (patch)
treed2d17ab0d82ffcdd26023d7c72a13c74d9bb3385 /socket.c
parent887cd3b25843477b742915fb5f365ad01e93b630 (diff)
downloadfetchmail-f50d39cc0c9f8487dde51788940bbce975a43503.tar.gz
fetchmail-f50d39cc0c9f8487dde51788940bbce975a43503.tar.bz2
fetchmail-f50d39cc0c9f8487dde51788940bbce975a43503.zip
gcc -Wall cleanup.
svn path=/trunk/; revision=2278
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/socket.c b/socket.c
index 7e11a701..9af6b7cf 100644
--- a/socket.c
+++ b/socket.c
@@ -49,27 +49,24 @@ static int handle_plugin(const char *host,
const char *service, const char *plugin)
/* get a socket mediated through a given external command */
{
- if (plugin)
+ int fds[2];
+ if (socketpair(AF_UNIX,SOCK_STREAM,0,fds))
{
- int fds[2];
- if (socketpair(AF_UNIX,SOCK_STREAM,0,fds))
- {
- error(0, 0, _("fetchmail: socketpair failed: %s(%d)"),strerror(errno),errno);
- return -1;
- }
- if (!fork())
- {
- dup2(fds[0],0);
- dup2(fds[0],1);
- if (outlevel >= O_VERBOSE)
- error(0, 0, _("running %s %s %s"), plugin, host, service);
- execlp(plugin,plugin,host,service,0);
- error(0, 0, _("execl(%s) failed: %s (%d)"),
- plugin, strerror(errno), errno);
- exit(0);
- }
- return fds[1];
+ error(0, 0, _("fetchmail: socketpair failed: %s(%d)"),strerror(errno),errno);
+ return -1;
+ }
+ if (!fork())
+ {
+ dup2(fds[0],0);
+ dup2(fds[0],1);
+ if (outlevel >= O_VERBOSE)
+ error(0, 0, _("running %s %s %s"), plugin, host, service);
+ execlp(plugin,plugin,host,service,0);
+ error(0, 0, _("execl(%s) failed: %s (%d)"),
+ plugin, strerror(errno), errno);
+ exit(0);
}
+ return fds[1];
}
#endif /* HAVE_SOCKETPAIR */