mirror of
https://github.com/nasa/trick.git
synced 2024-12-20 05:37:55 +00:00
We are redefining HOST_NAME_MAX in MonteCarlo.hh
Removed the redefinition. Included climits and changed HOST_NAME_MAX to _POSIX_HOST_NAME_MAX which should be defined on the systems we support. refs #265
This commit is contained in:
parent
3a7e756926
commit
f90a76be6b
@ -7,16 +7,13 @@
|
||||
|
||||
#include <deque>
|
||||
#include <vector>
|
||||
#include <climits>
|
||||
|
||||
#include "trick/MonteVar.hh"
|
||||
#include "trick/Executive.hh"
|
||||
#include "trick/RemoteShell.hh"
|
||||
#include "trick/tc.h"
|
||||
|
||||
#ifndef HOST_NAME_MAX
|
||||
#define HOST_NAME_MAX 128
|
||||
#endif
|
||||
|
||||
namespace Trick {
|
||||
|
||||
/**
|
||||
|
@ -22,8 +22,8 @@ Trick::MonteCarlo::MonteCarlo() :
|
||||
|
||||
slaves_head = NULL;
|
||||
|
||||
char hostname[HOST_NAME_MAX + 1];
|
||||
gethostname(hostname, HOST_NAME_MAX);
|
||||
char hostname[_POSIX_HOST_NAME_MAX + 1];
|
||||
gethostname(hostname, _POSIX_HOST_NAME_MAX);
|
||||
machine_name = hostname;
|
||||
|
||||
memset(&listen_device, 0, sizeof(TCDevice)) ;
|
||||
|
@ -131,7 +131,7 @@ void Trick::MonteCarlo::read_slave_port(Trick::MonteSlave *curr_slave) {
|
||||
|
||||
void Trick::MonteCarlo::read_machine_name(Trick::MonteSlave *curr_slave) {
|
||||
int num_bytes;
|
||||
char slave_name[HOST_NAME_MAX];
|
||||
char slave_name[_POSIX_HOST_NAME_MAX];
|
||||
|
||||
tc_read(&connection_device, (char *)&num_bytes, (int)sizeof(num_bytes));
|
||||
num_bytes = ntohl(num_bytes) ;
|
||||
|
@ -51,7 +51,7 @@ int Trick::MonteCarlo::slave_init() {
|
||||
int id = htonl(slave_id);
|
||||
tc_write(&connection_device, (char *)&id, (int)sizeof(id));
|
||||
|
||||
char hostname[HOST_NAME_MAX];
|
||||
char hostname[_POSIX_HOST_NAME_MAX];
|
||||
gethostname(hostname, sizeof(hostname)-1);
|
||||
|
||||
int num_bytes = htonl(strlen(hostname));
|
||||
|
Loading…
Reference in New Issue
Block a user