-/* $NetBSD: util.c,v 1.156 2011/12/10 05:53:58 lukem Exp $ */
+/* $NetBSD: util.c,v 1.157 2012/07/04 06:09:37 is Exp $ */
/*-
* Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: util.c,v 1.156 2011/12/10 05:53:58 lukem Exp $");
+__RCSID("$NetBSD: util.c,v 1.157 2012/07/04 06:09:37 is Exp $");
#endif /* not lint */
/*
* error message displayed.)
*/
int
-ftp_connect(int sock, const struct sockaddr *name, socklen_t namelen)
+ftp_connect(int sock, const struct sockaddr *name, socklen_t namelen, int pe)
{
int flags, rv, timeout, error;
socklen_t slen;
rv = connect(sock, name, namelen); /* inititate the connection */
if (rv == -1) { /* connection error */
if (errno != EINPROGRESS) { /* error isn't "please wait" */
+ if (pe || (errno != EHOSTUNREACH))
connecterror:
- warn("Can't connect to `%s:%s'", hname, sname);
+ warn("Can't connect to `%s:%s'", hname, sname);
return -1;
}