168 |
static void createprocinfo(); |
static void createprocinfo(); |
169 |
static char *append_hostname(char *); |
static char *append_hostname(char *); |
170 |
static void cleanup_md5_string(char *); |
static void cleanup_md5_string(char *); |
171 |
|
static void check_depend(); |
172 |
|
static void search_depend(Process_T p); |
173 |
%} |
%} |
174 |
|
|
175 |
%union { |
%union { |
665 |
|
|
666 |
} |
} |
667 |
|
|
668 |
|
/* Post-parse check the sanity of any dependency graph */ |
669 |
|
check_depend(); |
670 |
|
|
671 |
return ( cfg_errflag == 0 ); |
return ( cfg_errflag == 0 ); |
672 |
|
|
673 |
} |
} |
760 |
|
|
761 |
} |
} |
762 |
|
|
763 |
|
|
764 |
/* |
/* |
765 |
* Add a dependant entry to the current process dependant list |
* Add a dependant entry to the current process dependant list |
766 |
* |
* |
780 |
|
|
781 |
} |
} |
782 |
|
|
783 |
|
|
784 |
/* |
/* |
785 |
* Add a filename and its associated md5 checksum |
* Add a filename and its associated md5 checksum |
786 |
* to the current process checksumlist |
* to the current process checksumlist |
1322 |
} |
} |
1323 |
|
|
1324 |
|
|
1325 |
|
/* |
1326 |
|
* Check the dependency graph for any errors |
1327 |
|
*/ |
1328 |
|
static void check_depend() { |
1329 |
|
|
1330 |
|
Process_T p; |
1331 |
|
|
1332 |
|
for (p= processlist; p; p= p->next) { |
1333 |
|
if(p->visited) |
1334 |
|
continue; |
1335 |
|
search_depend(p); |
1336 |
|
} |
1337 |
|
|
1338 |
|
reset_depend(); |
1339 |
|
|
1340 |
|
} |
1341 |
|
|
1342 |
|
|
1343 |
|
|
1344 |
/* -------------------------------------------------------------------- Misc */ |
/* -------------------------------------------------------------------- Misc */ |
1345 |
|
|
1346 |
|
|
1366 |
|
|
1367 |
} |
} |
1368 |
|
|
1369 |
|
|
1370 |
/* |
/* |
1371 |
* Cleans up an md5 string, tolower and remove byte sperators |
* Cleans up an md5 string, tolower and remove byte sperators |
1372 |
*/ |
*/ |
|
|
|
1373 |
static void cleanup_md5_string(char *md5string) { |
static void cleanup_md5_string(char *md5string) { |
1374 |
|
|
1375 |
int i= 0, j= 0; |
int i= 0, j= 0; |
1394 |
return; |
return; |
1395 |
|
|
1396 |
} |
} |
1397 |
|
|
1398 |
|
|
1399 |
|
/* |
1400 |
|
* Search for any errors in the process dependency graph |
1401 |
|
*/ |
1402 |
|
static void search_depend(Process_T p) { |
1403 |
|
|
1404 |
|
if(p->visited) |
1405 |
|
return; |
1406 |
|
|
1407 |
|
if(p->dependantlist) { |
1408 |
|
|
1409 |
|
Dependant_T d; |
1410 |
|
|
1411 |
|
for(d= p->dependantlist; d; d= d->next ) { |
1412 |
|
|
1413 |
|
Process_T dp= get_process(d->dependant); |
1414 |
|
|
1415 |
|
if(!dp) { |
1416 |
|
log("%s: Error, depend process '%s' is not defined in the " |
1417 |
|
"control file\n", prog, d->dependant); |
1418 |
|
exit(1); |
1419 |
|
} |
1420 |
|
|
1421 |
|
if(dp->depend_visited) { |
1422 |
|
log("%s: Error, found a depend loop in the control file involving " |
1423 |
|
"the process '%s'\n", prog, p->name); |
1424 |
|
exit(1); |
1425 |
|
} |
1426 |
|
|
1427 |
|
dp->depend_visited= TRUE; |
1428 |
|
search_depend(dp); |
1429 |
|
|
1430 |
|
} |
1431 |
|
} |
1432 |
|
|
1433 |
|
p->visited= TRUE; |
1434 |
|
|
1435 |
|
} |