Commit 61a8eb84 authored by claes's avatar claes

Priority-handling and check for existing files

parent cdeb2b17
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#elif defined OS_LINUX #elif defined OS_LINUX
# include <sys/wait.h> # include <sys/wait.h>
# include <sys/types.h> # include <sys/types.h>
# include <sys/stat.h>
# include <unistd.h>
#endif #endif
#include "pwr.h" #include "pwr.h"
...@@ -557,6 +559,10 @@ loadSectObject ( ...@@ -557,6 +559,10 @@ loadSectObject (
if (oh.cid == pwr_eClass_Node && oh.oid.vid == cp->node.nid) if (oh.cid == pwr_eClass_Node && oh.oid.vid == cp->node.nid)
cp->node.nod_oid = oh.oid; /* This is the node object. */ cp->node.nod_oid = oh.oid; /* This is the node object. */
if ( oh.flags.b.devOnly) {
// continue;
}
op = ivol_LoadObject(sts, vp, &oh, vol_mLink_load); op = ivol_LoadObject(sts, vp, &oh, vol_mLink_load);
if (op == NULL) { if (op == NULL) {
errh_LogError(&cp->log, "Loading object %s, %s, parent %s\n%m", errh_LogError(&cp->log, "Loading object %s, %s, parent %s\n%m",
...@@ -1771,6 +1777,9 @@ ini_ProcInsert ( ...@@ -1771,6 +1777,9 @@ ini_ProcInsert (
{ {
ini_sProc *pp; ini_sProc *pp;
char buf[255]; char buf[255];
char *s;
int ret;
struct stat f_stat;
pwr_dStatus(sts, status, INI__SUCCESS); pwr_dStatus(sts, status, INI__SUCCESS);
...@@ -1787,6 +1796,22 @@ ini_ProcInsert ( ...@@ -1787,6 +1796,22 @@ ini_ProcInsert (
if (file != NULL && file[0] != '\0' && strcmp(file, "\"\"")) { if (file != NULL && file[0] != '\0' && strcmp(file, "\"\"")) {
if (pp->proc.file != NULL) free(pp->proc.file); if (pp->proc.file != NULL) free(pp->proc.file);
pp->proc.file = strsav(file); pp->proc.file = strsav(file);
#if defined(OS_LINUX)
s = getenv("pwr_exe");
sprintf(buf, "%s/%s", s, file);
ret = stat(buf, &f_stat);
if (ret == -1)
{
s = getenv("pwrp_exe");
sprintf(buf, "%s/%s", s, file);
ret = stat(buf, &f_stat);
if (ret == -1)
{
pp->flags.b.run = 0;
pp->proc.flags.b.load = 0;
}
}
#endif
} }
if (arg != NULL && arg[0] != '\0' && strcmp(arg, "\"\"")) { if (arg != NULL && arg[0] != '\0' && strcmp(arg, "\"\"")) {
if (pp->proc.arg != NULL) free(pp->proc.arg); if (pp->proc.arg != NULL) free(pp->proc.arg);
...@@ -1872,8 +1897,10 @@ ini_ProcPrio ( ...@@ -1872,8 +1897,10 @@ ini_ProcPrio (
if (pp->flags.b.run) { if (pp->flags.b.run) {
#if defined(OS_LINUX) #if defined(OS_LINUX)
if (!(pp->flags.b.plc)) {
sprintf(set, "rt_prio -rp %d %d", pp->proc.p_prio, pp->proc.pid); sprintf(set, "rt_prio -rp %d %d", pp->proc.p_prio, pp->proc.pid);
system(set); system(set);
}
#endif #endif
} }
} }
......
...@@ -195,6 +195,7 @@ start ( ...@@ -195,6 +195,7 @@ start (
ini_ProcIter(&sts, cp, proc_mProcess_user, ini_ProcLoad); ini_ProcIter(&sts, cp, proc_mProcess_user, ini_ProcLoad);
ini_ProcIter(&sts, cp, proc_mProcess_user, ini_ProcStart); ini_ProcIter(&sts, cp, proc_mProcess_user, ini_ProcStart);
ini_ProcIter(&sts, cp, proc_mProcess_user, ini_ProcPrio);
qcom_CreateQ(&sts, &cp->eventQ, NULL, "iniEvent"); qcom_CreateQ(&sts, &cp->eventQ, NULL, "iniEvent");
if (EVEN(sts)) { if (EVEN(sts)) {
...@@ -451,7 +452,7 @@ terminate ( ...@@ -451,7 +452,7 @@ terminate (
*/ */
/* Now sleep for a while */ /* Now sleep for a while */
sleep(2); sleep(3);
/* Unlink shared memory and semaphores */ /* Unlink shared memory and semaphores */
......
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