Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/slip/slip.c

    rb4edc96 r4c6fd56  
    11/*
    2  * Copyright (c) 2021 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * Copyright (c) 2013 Jakub Jermar
    44 * All rights reserved.
     
    307307        chardev_t *chardev_out = NULL;
    308308        fid_t fid;
     309        loc_srv_t *srv;
    309310        errno_t rc;
    310311
     
    314315        async_set_fallback_port_handler(slip_client_conn, NULL);
    315316
    316         rc = loc_server_register(NAME);
     317        rc = loc_server_register(NAME, &srv);
    317318        if (rc != EOK) {
    318319                log_msg(LOG_DEFAULT, LVL_ERROR,
     
    323324        rc = loc_service_get_id(svcstr, &svcid, 0);
    324325        if (rc != EOK) {
     326                loc_server_unregister(srv);
    325327                log_msg(LOG_DEFAULT, LVL_ERROR,
    326328                    "Failed getting ID for service %s", svcstr);
     
    330332        rc = loc_category_get_id(CAT_IPLINK, &iplinkcid, 0);
    331333        if (rc != EOK) {
     334                loc_server_unregister(srv);
    332335                log_msg(LOG_DEFAULT, LVL_ERROR,
    333336                    "Failed to get category ID for %s",
     
    342345        sess_out = loc_service_connect(svcid, INTERFACE_DDF, 0);
    343346        if (!sess_out) {
     347                loc_server_unregister(srv);
    344348                log_msg(LOG_DEFAULT, LVL_ERROR,
    345349                    "Failed to connect to service %s (ID=%d)",
     
    350354        rc = chardev_open(sess_out, &chardev_out);
    351355        if (rc != EOK) {
     356                loc_server_unregister(srv);
    352357                log_msg(LOG_DEFAULT, LVL_ERROR,
    353358                    "Failed opening character device.");
     
    373378        }
    374379
    375         rc = loc_service_register(linkstr, &linksid);
     380        rc = loc_service_register(srv, linkstr, &linksid);
    376381        if (rc != EOK) {
    377382                log_msg(LOG_DEFAULT, LVL_ERROR,
     
    381386        }
    382387
    383         rc = loc_service_add_to_cat(linksid, iplinkcid);
    384         if (rc != EOK) {
     388        rc = loc_service_add_to_cat(srv, linksid, iplinkcid);
     389        if (rc != EOK) {
     390                loc_service_unregister(srv, linksid);
    385391                log_msg(LOG_DEFAULT, LVL_ERROR,
    386392                    "Failed to add service %d (%s) to category %d (%s).",
     
    401407
    402408fail:
     409        loc_server_unregister(srv);
    403410        chardev_close(chardev_out);
    404411        if (sess_out)
Note: See TracChangeset for help on using the changeset viewer.