From b59ee313cc8dac735e21d2ba01fbed243eca9e9f Mon Sep 17 00:00:00 2001
From: Peter S. Mazinger <ps.m@gmx.net>
Date: Sat, 19 Mar 2011 01:05:36 +0100
Subject: [PATCH 117/396] resolv.c: include param.h and use MIN instead of min

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
---
 libc/inet/resolv.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 397420c..1487957 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -315,6 +315,7 @@ Domain name in a message can be represented as either:
 #include <sys/utsname.h>
 #include <sys/un.h>
 #include <sys/stat.h>
+#include <sys/param.h>
 #include <bits/uClibc_mutex.h>
 #include "internal/parse_config.h"
 
@@ -1824,21 +1825,18 @@ int getnameinfo(const struct sockaddr *sa,
 
 				if (hoste) {
 					char *c;
-#undef min
-#define min(x,y) (((x) > (y)) ? (y) : (x))
 					if ((flags & NI_NOFQDN)
 					 && (getdomainname(domain, sizeof(domain)) == 0)
 					 && (c = strstr(hoste->h_name, domain)) != NULL
 					 && (c != hoste->h_name) && (*(--c) == '.')
 					) {
 						strncpy(host, hoste->h_name,
-							min(hostlen, (size_t) (c - hoste->h_name)));
-						host[min(hostlen - 1, (size_t) (c - hoste->h_name))] = '\0';
+							MIN(hostlen, (size_t) (c - hoste->h_name)));
+						host[MIN(hostlen - 1, (size_t) (c - hoste->h_name))] = '\0';
 					} else {
 						strncpy(host, hoste->h_name, hostlen);
 					}
 					ok = 1;
-#undef min
 				}
 			}
 
-- 
1.7.0.4

