git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handlers moved to separate file and added to compilation
[stg.git]
/
stglibs
/
scriptexecuter.lib
/
scriptexecuter.cpp
diff --git
a/stglibs/scriptexecuter.lib/scriptexecuter.cpp
b/stglibs/scriptexecuter.lib/scriptexecuter.cpp
index 6e21a28f0de663f03a0b234e30c6a0b573611e3e..abe0185ca68b8ba4c8f516fe8aae1354c1ecd9fa 100644
(file)
--- a/
stglibs/scriptexecuter.lib/scriptexecuter.cpp
+++ b/
stglibs/scriptexecuter.lib/scriptexecuter.cpp
@@
-8,6
+8,7
@@
#include <cerrno>
#include <csignal>
#include <cerrno>
#include <csignal>
+#include "stg/common.h"
#include "scriptexecuter.h"
using namespace std;
#include "scriptexecuter.h"
using namespace std;
@@
-32,14
+33,16
@@
nonstop = false;
int ScriptExec(const string & str)
{
if (str.length() >= MAX_SCRIPT_LEN)
int ScriptExec(const string & str)
{
if (str.length() >= MAX_SCRIPT_LEN)
+ {
+ printfd(__FILE__, "ScriptExec() - script params exceeds MAX_SCRIPT_LENGTH (%d > %d)\n", str.length(), MAX_SCRIPT_LEN);
return -1;
return -1;
+ }
-int ret;
strncpy(sd.script, str.c_str(), MAX_SCRIPT_LEN);
sd.mtype = 1;
strncpy(sd.script, str.c_str(), MAX_SCRIPT_LEN);
sd.mtype = 1;
-ret = msgsnd(msgid, (void *)&sd, MAX_SCRIPT_LEN, 0);
-if (ret < 0)
+if (msgsnd(msgid, (void *)&sd, MAX_SCRIPT_LEN, 0) < 0)
{
{
+ printfd(__FILE__, "ScriptExec() - failed to send message to the IPC queue: '%s'\n", strerror(errno));
return -1;
}
return 0;
return -1;
}
return 0;
@@
-116,5
+119,3
@@
while (nonstop)
}
}
//-----------------------------------------------------------------------------
}
}
//-----------------------------------------------------------------------------
-
-