Changeset f039dba in mainline for uspace/srv/logger/ctl.c
- Timestamp:
- 2012-08-17T09:57:27Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b1912b0c
- Parents:
- f72ae3b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/logger/ctl.c
rf72ae3b rf039dba 43 43 #include "logger.h" 44 44 45 static int handle_ toplog_level_change(sysarg_t new_level)45 static int handle_log_level_change(sysarg_t new_level) 46 46 { 47 void * top_name;48 int rc = async_data_write_accept(& top_name, true, 0, 0, 0, NULL);47 void *full_name; 48 int rc = async_data_write_accept(&full_name, true, 0, 0, 0, NULL); 49 49 if (rc != EOK) { 50 50 return rc; 51 51 } 52 52 53 logger_ toplevel_log_t *toplog = find_or_create_toplevel_log(top_name);54 free( top_name);55 if ( toplog == NULL)53 logger_log_t *log = find_log_by_name(full_name); 54 free(full_name); 55 if (log == NULL) 56 56 return ENOENT; 57 57 58 toplog->logged_level = new_level;58 log->logged_level = new_level; 59 59 60 60 return EOK; 61 }62 63 static int handle_log_level_change(sysarg_t new_level)64 {65 void *top_name;66 int rc = async_data_write_accept(&top_name, true, 0, 0, 0, NULL);67 if (rc != EOK) {68 return rc;69 }70 71 logger_toplevel_log_t *toplog = find_or_create_toplevel_log(top_name);72 free(top_name);73 if (toplog == NULL)74 return ENOENT;75 76 77 void *log_name;78 rc = async_data_write_accept(&log_name, true, 0, 0, 0, NULL);79 if (rc != EOK)80 return rc;81 82 rc = ENOENT;83 for (size_t i = 0; i < toplog->sublog_count; i++) {84 if (str_cmp(toplog->sublogs[i].name, (const char *) log_name) == 0) {85 toplog->sublogs[i].logged_level = new_level;86 rc = EOK;87 break;88 }89 }90 91 free(log_name);92 93 return rc;94 61 } 95 62 … … 109 76 case LOGGER_CTL_SET_DEFAULT_LEVEL: { 110 77 int rc = set_default_logging_level(IPC_GET_ARG1(call)); 111 async_answer_0(callid, rc);112 break;113 }114 case LOGGER_CTL_SET_TOP_LOG_LEVEL: {115 int rc = handle_toplog_level_change(IPC_GET_ARG1(call));116 78 async_answer_0(callid, rc); 117 79 break;
Note:
See TracChangeset
for help on using the changeset viewer.