#include "osrf_application.h"
#include "osrf_prefork.h"
+char* __osrfSystemHostname = NULL;
+
void __osrfSystemSignalHandler( int sig );
transport_client* __osrfGlobalTransportClient;
int osrfSystemBootstrap( char* hostname, char* configfile, char* contextNode ) {
- if( !(configfile && contextNode) ) return -1;
+ if( !(hostname && configfile && contextNode) ) return -1;
+
+ __osrfSystemHostname = strdup(hostname);
/* first we grab the settings */
if(!osrfSystemBootstrapClientResc(configfile, contextNode, "settings_grabber" )) {
transport_client* client = client_init( domain, iport, unixpath, 0 );
- char* host = getenv("HOSTNAME");
+ char* host;
+ if(__osrfSystemHostname) host = __osrfSystemHostname;
+ else host = getenv("HOSTNAME");
+ if( host == NULL ) = "";
if(!resource) resource = "";
int len = strlen(resource) + 256;