Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 2f04bdd in mainline


Ignore:
Timestamp:
2020-01-05T03:04:37Z (11 months ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
16d748ee
Parents:
34e91bf
git-author:
Matthieu Riolo <matthieu.riolo@…> (2019-11-16 23:37:32)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2020-01-05 03:04:37)
Message:

Ensuring that taskman does not initialize itself

Taskman used to try to establish a connection to itself,
which of course did not work. With the old async api
this was not a big issue. But with the new one the taskman
port ends up being blocked.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/libc.c

    r34e91bf r2f04bdd  
    4646#include <vfs/inbox.h>
    4747#include <io/kio.h>
     48#include <str.h>
     49#include <stats.h>
     50
    4851#include "private/libc.h"
    4952#include "private/async.h"
     
    6669{
    6770        if (__pcb == NULL) {
    68                 async_sess_t *session_tm = taskman_connect();
    69                 if (session_tm == NULL) {
     71                //make sure taskman does not initialize itself
     72                stats_task_t *stats = stats_get_task(task_get_id());
     73                if (stats == NULL || stats->name == NULL)
    7074                        abort();
     75
     76                if (str_cmp(stats->name, "init:taskman") != 0) {
     77                        async_sess_t *session_tm = taskman_connect();
     78                        if (session_tm == NULL)
     79                                abort();
     80                        __task_init(session_tm);
    7181                }
    72                 __task_init(session_tm);
     82
     83                free(stats);
    7384        } else {
    7485                __task_init(__pcb->session_taskman);
Note: See TracChangeset for help on using the changeset viewer.