Commit a4921502 authored by Robert Ricci's avatar Robert Ricci
Browse files

Added code in dostate() to chomp whitespace off the end of the new

state string. This was causing (tremendously frustrating) problems
elsewhere.
parent 5600aa42
......@@ -2344,8 +2344,19 @@ COMMAND_PROTOTYPE(dostate)
while (isspace(*rdata)) {
rdata++;
}
/*
* Pull blanks off the end of rdata
*/
newstate = rdata + (strlen(rdata) -1);
while ((newstate >= rdata) && (*newstate == ' ')) {
*newstate = '\0';
newstate--;
}
newstate = rdata;
#ifdef EVENTSYS
/*
* Send the state out via an event
......@@ -2361,6 +2372,7 @@ COMMAND_PROTOTYPE(dostate)
tuple->objtype = "TBNODESTATE";
tuple->objname = nodeid;
tuple->eventtype = newstate;
printf("Newstate is (%s)\n",newstate);
if (myevent_send(tuple)) {
syslog(LOG_ERR,"dostate: Error sending event\n");
......
Supports Markdown
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