Changeset f9b2cb4c in mainline for uspace/srv/logger/main.c


Ignore:
Timestamp:
2015-08-23T12:50:23Z (9 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9ef495f
Parents:
0dd16778
Message:

unify interface API

  • introduce new interfaces
  • unify location service clients to always expect service ID as the second argument
  • remove obsolete methods that take explicit exchange management arguments (first phase)
  • use interfaces in device drivers, devman, location service, logger, inet
File:
1 edited

Legend:

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

    r0dd16778 rf9b2cb4c  
    4848#include "logger.h"
    4949
    50 static void connection_handler(ipc_callid_t iid, ipc_call_t *icall, void *arg)
     50static void connection_handler_control(ipc_callid_t iid, ipc_call_t *icall,
     51    void *arg)
    5152{
    52         logger_interface_t iface = IPC_GET_ARG1(*icall);
     53        logger_connection_handler_control(iid);
     54}
    5355
    54         switch (iface) {
    55         case LOGGER_INTERFACE_CONTROL:
    56                 logger_connection_handler_control(iid);
    57                 break;
    58         case LOGGER_INTERFACE_WRITER:
    59                 logger_connection_handler_writer(iid);
    60                 break;
    61         default:
    62                 async_answer_0(iid, EINVAL);
    63                 break;
    64         }
     56static void connection_handler_writer(ipc_callid_t iid, ipc_call_t *icall,
     57    void *arg)
     58{
     59        logger_connection_handler_writer(iid);
    6560}
    6661
     
    7368                parse_level_settings(argv[i]);
    7469        }
    75 
    76         async_set_fallback_port_handler(connection_handler, NULL);
    7770       
    78         int rc = service_register(SERVICE_LOGGER);
     71        port_id_t port;
     72        int rc = async_create_port(INTERFACE_LOGGER_CONTROL,
     73            connection_handler_control, NULL, &port);
     74        if (rc != EOK)
     75                return rc;
     76       
     77        rc = async_create_port(INTERFACE_LOGGER_WRITER,
     78            connection_handler_writer, NULL, &port);
     79        if (rc != EOK)
     80                return rc;
     81       
     82        rc = service_register(SERVICE_LOGGER);
    7983        if (rc != EOK) {
    8084                printf(NAME ": failed to register: %s.\n", str_error(rc));
Note: See TracChangeset for help on using the changeset viewer.