diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-12-15 16:17:21 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-12-15 16:17:21 +0000 |
commit | f50d39cc0c9f8487dde51788940bbce975a43503 (patch) | |
tree | d2d17ab0d82ffcdd26023d7c72a13c74d9bb3385 /socket.c | |
parent | 887cd3b25843477b742915fb5f365ad01e93b630 (diff) | |
download | fetchmail-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.c | 35 |
1 files changed, 16 insertions, 19 deletions
@@ -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 */ |