*** ./src/nrpe.c.ORIG	Wed Nov 20 13:26:50 2013
--- ./src/nrpe.c	Wed Nov 20 13:27:51 2013
***************
*** 868,873 ****
--- 868,877 ----
  	syslog(LOG_INFO, "Server listening on %s port %s.", ntop, strport);
  	}
  
+ #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61))
+ #define ss_family __ss_family
+ #endif
+ 
  /* wait for incoming connection requests */
  void wait_for_connections(void){
  	struct addrinfo *ai;
*** ./src/utils.c.ORIG	Wed Dec  7 16:19:57 2016
--- ./src/utils.c	Wed Dec  7 16:21:00 2016
***************
*** 240,245 ****
--- 240,283 ----
  	*listen_addrs = aitop;
  }
  
+ /***************************************************************************
+                                  unsetenv()
+  ****************************************************************************/
+ 
+ #if defined(_AIX) && !defined(_AIX52)
+ int
+ unsetenv( const char *name )
+ {
+   size_t len;
+   char **ep;
+ 
+   if ((name == NULL) || (*name == '\0') || (strchr( name, '=' ) != NULL))
+   {
+     errno = EINVAL;
+     return( -1 );
+   }
+ 
+   len = strlen( name );
+ 
+   ep = environ;
+   while (*ep != NULL)
+     if (! strncmp( *ep, name, len ) && (*ep)[len] == '=')
+     {
+ /* Found it.  Remove this pointer by moving later ones back.  */
+       char **dp = ep;
+ 
+       do
+         dp[0] = dp[1];
+       while (*dp++);
+ /* Continue the loop in case NAME appears again.  */
+     }
+   else
+     ++ep;
+ 
+   return( 0 );
+ }
+ #endif
+ 
  int clean_environ(const char *keep_env_vars, const char *nrpe_user)
  {
  #ifdef HAVE_PATHS_H
*** ./src/utils.c.ORIG	Thu Jul 27 18:14:28 2017
--- ./src/utils.c	Thu Jul 27 18:41:22 2017
***************
*** 504,509 ****
--- 504,513 ----
  	return begin;
  }
  
+ #ifndef O_NOFOLLOW
+ #define O_NOFOLLOW 0x0
+ #endif
+ 
  void open_log_file()
  {
  	int fh;
