Merge branch 'develop' of ssh://gitlab.psi.ch/sinqdev/sics into develop

This commit is contained in:
2016-12-15 17:04:09 +01:00
98 changed files with 3469 additions and 3646 deletions
+11 -10
View File
@@ -6,7 +6,6 @@
#include "sicsobj.h"
#include "splitter.h"
#include "initializer.h"
#include "commandlog.h"
#include "hipadaba.h"
#include "sicshipadaba.h"
#include "dynstring.h"
@@ -516,14 +515,14 @@ static char *SctActionHandler(void *actionData, char *lastReply,
emsg = GetHdbProp(node, eprop);
if (emsg == NULL || con != controller->conn) {
GetHdbPath(node, path, sizeof path);
SCPrintf(con, eLogError,
"ERROR: action {%s} in {%s} node %s:\nERROR: %s",
snprintf(msg,sizeof(msg),"ERROR: action {%s} in {%s} node %s:\nERROR: %s",
data->name, origScript, path, result);
SCPureSockWrite(con, msg,eLogError);
if(data != NULL && data->controller != NULL){
traceIO(data->controller->node->name, "ERROR: action {%s} in {%s} node %s:\nERROR: %s",
traceIO(data->controller->node->name, "ERROR: action {%s} in {%s} node %s:ERROR: %s",
data->name, origScript, path, result);
} else {
traceIO("sctunknown", "ERROR: action {%s} in {%s} node %s:\nERROR: %s",
traceIO("sctunknown", "ERROR: action {%s} in {%s} node %s:ERROR: %s",
data->name, origScript, path, result);
}
}
@@ -600,7 +599,7 @@ static char *SctActionHandler(void *actionData, char *lastReply,
*/
iMacro = SCinMacro(con);
con->iMacro = 0;
SCWrite(con, "o.k.", eWarning);
SCPureSockWrite(con, "o.k.", eLog);
SCsetMacro(con, iMacro);
}
}
@@ -637,7 +636,8 @@ static char *SctActionHandler(void *actionData, char *lastReply,
if (send == NULL)
send = "";
if (controller->verbose) {
SCPrintf(con, eLog, "%6.3f send : %s", secondsOfMinute(), send);
snprintf(msg,sizeof(msg),"%6.3f send : %s", secondsOfMinute(), send);
SCPureSockWrite(con, msg,eLog);
}
if (controller->fd != NULL) {
fprintf(controller->fd, "%6.3f send : %s\n", secondsOfMinute(), send);
@@ -768,7 +768,9 @@ static hdbCallbackReturn SctMainCallback(Hdb * node, void *userData,
geterror = GetHdbProp(node, "geterror");
if (geterror != NULL) {
snprintf(error,255,"ERROR: %s", geterror);
SCWrite(con, error, eError);
if(con != NULL){
SCWrite(con, error, eError);
}
if (mm->v->dataType == HIPTEXT) {
if (mm->v->v.text != NULL) {
free(mm->v->v.text);
@@ -838,7 +840,6 @@ static hdbCallbackReturn SctActionCallback(Hdb * node, void *userData,
if (script != NULL) {
if (SctCallInContext(con, script, node, data->controller, &error) ==
0) {
/* SCPrintf(con, eError, "ERROR: in {%s}: %s", script, error); */
SCPrintf(con, eError, "ERROR: %s", error); /* nicer for the user */
SetHdbProperty(node, "target", NULL);
SetHdbProperty(node, "requested", NULL);
@@ -1853,7 +1854,7 @@ static void SctKillController(void *c)
if (pServ->pTasker) {
TaskRegisterN(pServ->pTasker,"killsct", SctDeferredTask, NULL, SctDeferredFree,
controller, 0);
controller, TASK_PRIO_HIGH);
} else {
free(controller);
}