From f50d39cc0c9f8487dde51788940bbce975a43503 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 15 Dec 1998 16:17:21 +0000 Subject: gcc -Wall cleanup. svn path=/trunk/; revision=2278 --- socket.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'socket.c') 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 */ -- cgit v1.2.3