Changeset 7034b443 in mainline
- Timestamp:
- 2012-08-16T12:02:53Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 717a0aa
- Parents:
- 494f417
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/logctl.c
r494f417 r7034b443 45 45 static async_sess_t *logger_session = NULL; 46 46 47 static int connect_to_logger()47 static int start_logger_exchange(async_exch_t **exchange_out) 48 48 { 49 if (logger_session != NULL) 50 return EOK; 49 assert(exchange_out != NULL); 51 50 52 logger_session = service_connect_blocking(EXCHANGE_SERIALIZE, 53 SERVICE_LOGGER, LOGGER_INTERFACE_CONTROL, 0); 54 if (logger_session == NULL) 51 if (logger_session == NULL) { 52 logger_session = service_connect_blocking(EXCHANGE_SERIALIZE, 53 SERVICE_LOGGER, LOGGER_INTERFACE_CONTROL, 0); 54 if (logger_session == NULL) 55 return ENOMEM; 56 } 57 58 assert(logger_session != NULL); 59 60 async_exch_t *exchange = async_exchange_begin(logger_session); 61 if (exchange == NULL) 55 62 return ENOMEM; 63 64 *exchange_out = exchange; 56 65 57 66 return EOK; … … 61 70 int logctl_set_default_level(log_level_t new_level) 62 71 { 63 int rc = connect_to_logger(); 72 async_exch_t *exchange = NULL; 73 int rc = start_logger_exchange(&exchange); 64 74 if (rc != EOK) 65 75 return rc; 66 67 async_exch_t *exchange = async_exchange_begin(logger_session);68 if (exchange == NULL)69 return ENOMEM;70 76 71 77 rc = (int) async_req_1_0(exchange, … … 79 85 int logctl_set_namespace_level(const char *namespace, log_level_t new_level) 80 86 { 81 int rc = connect_to_logger(); 87 async_exch_t *exchange = NULL; 88 int rc = start_logger_exchange(&exchange); 82 89 if (rc != EOK) 83 90 return rc; 84 85 async_exch_t *exchange = async_exchange_begin(logger_session);86 if (exchange == NULL)87 return ENOMEM;88 91 89 92 aid_t reg_msg = async_send_1(exchange, LOGGER_CTL_SET_NAMESPACE_LEVEL,
Note:
See TracChangeset
for help on using the changeset viewer.