From 5f2a181599d4c26dabf68097f2cae5ef01675a52 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jul 2015 09:08:45 -0600 Subject: [PATCH] Add conditional definition for MIN macro needed in last commit --- configs | 2 +- libc/unistd/lib_gethostname.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/configs b/configs index 011c54d78c..ef0ed726cc 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 011c54d78c920cd7bd0872638983444436e749dc +Subproject commit ef0ed726cc999572b60228cc8a4f482f53e6a228 diff --git a/libc/unistd/lib_gethostname.c b/libc/unistd/lib_gethostname.c index fb2fb3557b..a804ca5dfc 100644 --- a/libc/unistd/lib_gethostname.c +++ b/libc/unistd/lib_gethostname.c @@ -71,6 +71,14 @@ # define CONFIG_NET_HOSTNAME "" #endif +#ifndef MIN +# define MIN(a,b) ((a) < (b) ? (a) : (b)) +#endif + +#ifndef MAX +# define MAX(a,b) ((a) > (b) ? (a) : (b)) +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -150,7 +158,7 @@ int sethostname(FAR const char *name, size_t size) irqstate_t flags; /* Save the new host name, truncating to HOST_NAME_MAX if necessary. This - * internal copy is always NUL terminated .The hostname is global resource. + * internal copy is always NUL terminated. The hostname is global resource. * There is a microscopic possibility that it could be accessed while we * are setting it. */