Skip to content
Snippets Groups Projects
Commit 6d1badda authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

use new macro of oblibs

parent 421581b1
No related branches found
No related tags found
No related merge requests found
...@@ -58,10 +58,6 @@ ...@@ -58,10 +58,6 @@
#define FLAGS_UNBLOCK (1 << 5) // 32 all deps up/down #define FLAGS_UNBLOCK (1 << 5) // 32 all deps up/down
#define FLAGS_FATAL (1 << 6) // 64 process crashed #define FLAGS_FATAL (1 << 6) // 64 process crashed
/** return 1 if set, else 0*/
#define FLAGS_ISSET(has, want) \
((~(has) & (want)) == 0)
typedef struct pidvertex_s pidvertex_t, *pidvertex_t_ref ; typedef struct pidvertex_s pidvertex_t, *pidvertex_t_ref ;
struct pidvertex_s struct pidvertex_s
{ {
...@@ -468,9 +464,9 @@ static void pidvertex_init_array(pidvertex_t *apidv, graph_t *g, unsigned int *l ...@@ -468,9 +464,9 @@ static void pidvertex_init_array(pidvertex_t *apidv, graph_t *g, unsigned int *l
log_dieu(LOG_EXIT_SYS, "read resolve file of tree: ", name) ; log_dieu(LOG_EXIT_SYS, "read resolve file of tree: ", name) ;
if (r) if (r)
pidv.state |= FLAGS_UP ; FLAGS_SET(pidv.state, FLAGS_UP) ;
else else
pidv.state |= FLAGS_DOWN ; FLAGS_SET(pidv.state, FLAGS_DOWN) ;
apidv[pos] = pidv ; apidv[pos] = pidv ;
} }
...@@ -635,13 +631,11 @@ static int async_deps(pidvertex_t *apidv, unsigned int i, unsigned int what, sse ...@@ -635,13 +631,11 @@ static int async_deps(pidvertex_t *apidv, unsigned int i, unsigned int what, sse
switch(action) { switch(action) {
case GOTIT: case GOTIT:
apidv[pos].state = 0 ; FLAGS_SET(apidv[pos].state, (!what ? FLAGS_UP : FLAGS_DOWN)) ;
apidv[pos].state = (!what ? FLAGS_UP : FLAGS_DOWN) ;
goto next ; goto next ;
case FATAL: case FATAL:
apidv[pos].state = 0 ; FLAGS_SET(apidv[pos].state, FLAGS_FATAL) ;
apidv[pos].state = FLAGS_FATAL ;
goto err ; goto err ;
case WAIT: case WAIT:
...@@ -678,7 +672,7 @@ static int async(pidvertex_t *apidv, unsigned int i, unsigned int what, ssexec_t ...@@ -678,7 +672,7 @@ static int async(pidvertex_t *apidv, unsigned int i, unsigned int what, ssexec_t
if (!FLAGS_ISSET(apidv[i].state, FLAGS_BLOCK)) { if (!FLAGS_ISSET(apidv[i].state, FLAGS_BLOCK)) {
apidv[i].state |= FLAGS_BLOCK ; FLAGS_SET(apidv[i].state, FLAGS_BLOCK) ;
if (apidv[i].nedge) if (apidv[i].nedge)
if (!async_deps(apidv, i, what, info, graph, deadline)) if (!async_deps(apidv, i, what, info, graph, deadline))
...@@ -819,19 +813,19 @@ int ssexec_all(int argc, char const *const *argv,char const *const *envp, ssexec ...@@ -819,19 +813,19 @@ int ssexec_all(int argc, char const *const *argv,char const *const *envp, ssexec
if (what) { if (what) {
requiredby = 1 ; requiredby = 1 ;
flag = FLAGS_UP ; FLAGS_SET(flag, FLAGS_UP) ;
flag_run = FLAGS_STOPPING ; FLAGS_SET(flag_run, FLAGS_STOPPING) ;
} else { } else {
flag = FLAGS_DOWN ; FLAGS_SET(flag, FLAGS_DOWN) ;
flag_run = FLAGS_STARTING ; FLAGS_SET(flag_run, FLAGS_STARTING) ;
} }
if ((scandir_ok(info->scandir.s)) <= 0) if ((scandir_ok(info->scandir.s)) <= 0)
log_die(LOG_EXIT_SYS,"scandir: ", info->scandir.s," is not running") ; log_die(LOG_EXIT_SYS,"scandir: ", info->scandir.s," is not running") ;
if (!graph_build_g(&graph, info->base.s, info->treename.s, DATA_TREE)) if (!graph_build_g(&graph, info->base.s, info->treename.s, DATA_TREE, 0))
log_dieu(LOG_EXIT_SYS,"build the graph") ; log_dieu(LOG_EXIT_SYS,"build the graph") ;
/** initialize and allocate apidvertex array */ /** initialize and allocate apidvertex array */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment