From 4e312373e9f83285b965043813bf7dfce4c09a6d Mon Sep 17 00:00:00 2001
From: Yubin Ruan <ablacktshirt@gmail.com>
Date: Thu, 23 Mar 2017 08:34:38 +0000
Subject: [PATCH] fix porting problem

---
 configure.ac            | 7 ++++++-
 libnetbsd/getnameinfo.c | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2754750..f93fd76 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ AC_CONFIG_MACRO_DIR([buildaux])
 AC_CONFIG_HEADERS([tnftp_config.h])
 AC_CONFIG_LIBOBJ_DIR([libnetbsd])
 
-AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc silent-rules])
+AM_INIT_AUTOMAKE([-Wall foreign nostdinc silent-rules])
 AM_MAINTAINER_MODE()
 
 #
@@ -114,6 +114,11 @@ AC_SEARCH_LIBS([socket],
                              [-lnsl])])
 
 #
+# haiku has `getpass()' in libbsd.so
+#
+AC_SEARCH_LIBS(getpass, bsd)
+
+#
 # Check for (Dante) SOCKS5.
 #
 AS_IF([test "$with_socks" != no],
diff --git a/libnetbsd/getnameinfo.c b/libnetbsd/getnameinfo.c
index d72372c..7253196 100644
--- a/libnetbsd/getnameinfo.c
+++ b/libnetbsd/getnameinfo.c
@@ -88,7 +88,7 @@ static int ip6_sa2str(const struct sockaddr_in6 *, char *, size_t, int);
 
 int
 getnameinfo(const struct sockaddr *sa, socklen_t salen,
-    char *host, size_t hostlen, char *serv, size_t servlen, int flags)
+    char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags)
 {
 	struct afd *afd;
 	struct servent *sp;
-- 
2.11.0

