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

Changeset 80d8885 in mainline for uspace/srv/logger/main.c


Ignore:
Timestamp:
2012-08-16T15:08:19Z (9 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
dc5aa568
Parents:
32b26cf7
Message:

Set levels for individual contexts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/logger/main.c

    r32b26cf7 r80d8885  
    6767}
    6868
     69static int handle_context_level_change(sysarg_t new_level)
     70{
     71        void *namespace_name;
     72        int rc = async_data_write_accept(&namespace_name, true, 0, 0, 0, NULL);
     73        if (rc != EOK) {
     74                return rc;
     75        }
     76
     77        logging_namespace_t *namespace = namespace_writer_attach((const char *) namespace_name);
     78        free(namespace_name);
     79        if (namespace == NULL)
     80                return ENOENT;
     81
     82        void *context_name;
     83        rc = async_data_write_accept(&context_name, true, 0, 0, 0, NULL);
     84        if (rc != EOK) {
     85                namespace_writer_detach(namespace);
     86                return rc;
     87        }
     88
     89        rc = namespace_change_context_level(namespace, context_name, new_level);
     90        free(context_name);
     91        namespace_writer_detach(namespace);
     92
     93        return rc;
     94}
     95
    6996static void connection_handler_control(void)
    7097{
     
    90117                case LOGGER_CTL_SET_NAMESPACE_LEVEL:
    91118                        rc = handle_namespace_level_change(IPC_GET_ARG1(call));
     119                        async_answer_0(callid, rc);
     120                        break;
     121                case LOGGER_CTL_SET_CONTEXT_LEVEL:
     122                        rc = handle_context_level_change(IPC_GET_ARG1(call));
    92123                        async_answer_0(callid, rc);
    93124                        break;
Note: See TracChangeset for help on using the changeset viewer.