Commit cc2785d7 authored by fogal1's avatar fogal1

Lookup hostname so we can use it in error messages.

On some clusters, we can have one or two nodes with broken X
servers out of a whole job.  We need the hostname so we can inform
the admin[s] which nodes are broken.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@14766 18c085ea-50e0-402c-830e-de6fd14e8384
parent bef421fc
......@@ -122,6 +122,9 @@ XDisplay::~XDisplay()
// Tom Fogal, Mon May 24 18:58:57 MDT 2010
// Abstract most of this method out to `xinit'.
//
// Tom Fogal, Tue May 25 16:11:38 MDT 2010
// Lookup hostname; we'll use it in error messages.
//
// ****************************************************************************
bool
......@@ -130,6 +133,11 @@ XDisplay::Initialize(size_t display, const std::vector<std::string> &user_args)
this->display = display;
std::string disp = format(":%l", /* unused */ 0, display);
if(gethostname(this->hostname, 512) != 0)
{
debug1 << "Error " << errno << " while getting hostname.\n";
this->hostname[0] = 0;
}
if((this->xserver = xinit(disp, user_args)) == -1)
{
return false;
......
......@@ -52,6 +52,11 @@
// Programmer: Tom Fogal
// Creation: August 29, 2008
//
// Modifications:
//
// Tom Fogal, Tue May 25 15:49:00 MDT 2010
// Add hostname storage, for printing error messages.
//
// ****************************************************************************
class ENGINE_MAIN_API XDisplay : public VisItDisplay
......@@ -68,5 +73,6 @@ class ENGINE_MAIN_API XDisplay : public VisItDisplay
private:
pid_t xserver;
size_t display;
char hostname[256];
};
#endif /* VISIT_X_DISPLAY_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment