Changeset 102f641 in mainline for uspace/srv/sysman/job_closure.c


Ignore:
Timestamp:
2019-09-02T19:01:50Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
25697163
Parents:
241f1985
Message:

Correcting syntax according to ccheck

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/sysman/job_closure.c

    r241f1985 r102f641  
    3737#include "log.h"
    3838
    39 
    4039/** Struct describes how to traverse units graph */
    4140struct bfs_ops;
     
    5251         * return result of visit (error stops further traversal)
    5352         */
    54         int (* visit)(unit_t *, unit_edge_t *, bfs_ops_t *, void *);
     53        int (*visit)(unit_t *, unit_edge_t *, bfs_ops_t *, void *);
    5554
    5655        /** Clean units remaining in BFS queue after error */
    57         void (* clean)(unit_t *, bfs_ops_t *, void *);
     56        void (*clean)(unit_t *, bfs_ops_t *, void *);
    5857};
    5958
     
    6564{
    6665        assert(blocking_job->blocked_jobs.size ==
    67             blocking_job->blocked_jobs_count);
     66            blocking_job->blocked_jobs_count);
    6867
    6968        int rc = dyn_array_append(&blocking_job->blocked_jobs, job_t *,
     
    203202        unit->bfs_tag = true;
    204203        list_append(&unit->bfs_link, &units_fifo);
    205        
     204
    206205        while (!list_empty(&units_fifo)) {
    207206                unit = list_get_instance(list_first(&units_fifo), unit_t,
     
    209208                list_remove(&unit->bfs_link);
    210209
    211 
    212                 if (ops->direction == BFS_FORWARD)
    213                     list_foreach(unit->edges_out, edges_out, unit_edge_t, e) {
    214                         unit_t *u = e->output;
    215                         if (!u->bfs_tag) {
    216                                 u->bfs_tag = true;
    217                                 list_append(&u->bfs_link, &units_fifo);
     210                if (ops->direction == BFS_FORWARD) {
     211                        list_foreach(unit->edges_out, edges_out, unit_edge_t, e) {
     212                                unit_t *u = e->output;
     213                                if (!u->bfs_tag) {
     214                                        u->bfs_tag = true;
     215                                        list_append(&u->bfs_link, &units_fifo);
     216                                }
     217                                rc = ops->visit(u, e, ops, arg);
     218                                if (rc != EOK) {
     219                                        goto finish;
     220                                }
    218221                        }
    219                         rc = ops->visit(u, e, ops, arg);
    220                         if (rc != EOK) {
    221                                 goto finish;
    222                         }
    223                 } else
    224                     list_foreach(unit->edges_in, edges_in, unit_edge_t, e) {
    225                         unit_t *u = e->input;
    226                         if (!u->bfs_tag) {
    227                                 u->bfs_tag = true;
    228                                 list_append(&u->bfs_link, &units_fifo);
    229                         }
    230                         rc = ops->visit(u, e, ops, arg);
    231                         if (rc != EOK) {
    232                                 goto finish;
     222                } else {
     223                        list_foreach(unit->edges_in, edges_in, unit_edge_t, e) {
     224                                unit_t *u = e->input;
     225                                if (!u->bfs_tag) {
     226                                        u->bfs_tag = true;
     227                                        list_append(&u->bfs_link, &units_fifo);
     228                                }
     229                                rc = ops->visit(u, e, ops, arg);
     230                                if (rc != EOK) {
     231                                        goto finish;
     232                                }
    233233                        }
    234234                }
     
    243243                list_remove(cur_link);
    244244        }
    245        
     245
    246246        return rc;
    247247}
     
    349349        }
    350350
    351        
    352351        /* Clean after ourselves (BFS tag jobs) */
    353352        dyn_array_foreach(*job_closure, job_t *, job_it) {
     
    360359        return rc;
    361360}
    362 
Note: See TracChangeset for help on using the changeset viewer.