#ifdef GO500_HOSTNAME
strcpy( myhost, GO500_HOSTNAME );
#else
- if ( myhost[0] == '\0' && gethostname( myhost, sizeof(myhost) )
+ if ( myhost[0] == '\0' && gethostname( myhost, sizeof(myhost)-1 )
== -1 ) {
perror( "gethostname" );
exit( EXIT_FAILURE );
}
+ myhost[sizeof(myhost)-1] = '\0';
#endif
#ifdef HAVE_SYSCONF
}
#ifdef LDAP_PROCTITLE
- setproctitle( hp == NULL ? inet_ntoa( from.sin_addr ) :
+ setproctitle( "%s", hp == NULL ? inet_ntoa( from.sin_addr ) :
hp->h_name );
#endif
}
; /* NULL */
#endif
- (void) SIGNAL( SIGCHLD, wait4child );
+ (void) SIGNAL_REINSTALL ( SIGCHLD, wait4child );
}
static void