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

Changeset 04da852 in mainline


Ignore:
Timestamp:
2012-08-16T11:09:02Z (9 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
1c67b41
Parents:
c8cbd39
Message:

Read properly boot log level

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/io/logctl.c

    rc8cbd39 r04da852  
    3838#include <sysinfo.h>
    3939#include <ns.h>
     40#include <str.h>
    4041
    41 #define SYSINFO_DEFAULT_LOG_LEVEL "logger.level"
     42#define SYSINFO_LOGGGER_BOOT_ARGUMENT "init_args.logger"
    4243
    4344/** IPC session with the logger service. */
     
    7879int logctl_get_boot_level(log_level_t *level)
    7980{
    80         sysarg_t boot_level_arg;
    81         int rc = sysinfo_get_value(SYSINFO_DEFAULT_LOG_LEVEL, &boot_level_arg);
    82         if (rc != EOK)
    83                 return rc;
     81        size_t argument_size;
     82        void *argument = sysinfo_get_data(SYSINFO_LOGGGER_BOOT_ARGUMENT, &argument_size);
     83        if (argument == NULL)
     84                return EINVAL;
    8485
    85         log_level_t boot_level = (log_level_t) boot_level_arg;
     86        char level_str[10];
     87        str_cpy(level_str, 10, (const char *) argument);
     88
     89        int level_int = strtol(level_str, NULL, 0);
     90
     91        log_level_t boot_level = (log_level_t) level_int;
    8692        if (boot_level >= LVL_LIMIT)
    8793                return EINVAL;
Note: See TracChangeset for help on using the changeset viewer.