From 75543537a16a0911af61045a96926cdb81f51383 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 8 Mar 2012 09:36:11 +0000 Subject: * Throughout, replace usage of w32api's min with MIN from sys/param.h. --- winsup/cygwin/fhandler_socket.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'winsup/cygwin/fhandler_socket.cc') diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 17d98dc38..f78002801 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -1,7 +1,7 @@ /* fhandler_socket.cc. See fhandler.h for a description of the fhandler classes. Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, - 2009, 2010, 2011 Red Hat, Inc. + 2009, 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -34,6 +34,7 @@ #include "sigproc.h" #include "wininfo.h" #include +#include #include #include "cygtls.h" #include "cygwin/in6.h" @@ -1213,12 +1214,12 @@ fhandler_socket::accept4 (struct sockaddr *peer, int *len, int flags) bound socket name of the peer's socket. For now we just fake an unbound socket on the other side. */ static struct sockaddr_un un = { AF_LOCAL, "" }; - memcpy (peer, &un, min (*len, (int) sizeof (un.sun_family))); + memcpy (peer, &un, MIN (*len, (int) sizeof (un.sun_family))); *len = (int) sizeof (un.sun_family); } else { - memcpy (peer, &lpeer, min (*len, llen)); + memcpy (peer, &lpeer, MIN (*len, llen)); *len = llen; } } @@ -1247,7 +1248,7 @@ fhandler_socket::getsockname (struct sockaddr *name, int *namelen) sun.sun_path[0] = '\0'; if (get_sun_path ()) strncat (sun.sun_path, get_sun_path (), UNIX_PATH_LEN - 1); - memcpy (name, &sun, min (*namelen, (int) SUN_LEN (&sun) + 1)); + memcpy (name, &sun, MIN (*namelen, (int) SUN_LEN (&sun) + 1)); *namelen = (int) SUN_LEN (&sun) + (get_sun_path () ? 1 : 0); res = 0; } @@ -1261,7 +1262,7 @@ fhandler_socket::getsockname (struct sockaddr *name, int *namelen) res = ::getsockname (get_socket (), (struct sockaddr *) &sock, &len); if (!res) { - memcpy (name, &sock, min (*namelen, len)); + memcpy (name, &sock, MIN (*namelen, len)); *namelen = len; } else @@ -1290,7 +1291,7 @@ fhandler_socket::getsockname (struct sockaddr *name, int *namelen) } if (!res) { - memcpy (name, &sock, min (*namelen, len)); + memcpy (name, &sock, MIN (*namelen, len)); *namelen = len; } } @@ -1321,12 +1322,12 @@ fhandler_socket::getpeername (struct sockaddr *name, int *namelen) sun.sun_path[0] = '\0'; if (get_peer_sun_path ()) strncat (sun.sun_path, get_peer_sun_path (), UNIX_PATH_LEN - 1); - memcpy (name, &sun, min (*namelen, (int) SUN_LEN (&sun) + 1)); + memcpy (name, &sun, MIN (*namelen, (int) SUN_LEN (&sun) + 1)); *namelen = (int) SUN_LEN (&sun) + (get_peer_sun_path () ? 1 : 0); } else { - memcpy (name, &sock, min (*namelen, len)); + memcpy (name, &sock, MIN (*namelen, len)); *namelen = len; } -- cgit v1.2.3