Changeset 4c6fd56 in mainline for uspace/srv/hid/rfb/main.c


Ignore:
Timestamp:
2023-09-16T19:58:18Z (9 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7d7f5e3
Parents:
6a0b2cc
git-author:
Jiri Svoboda <jiri@…> (2023-09-16 19:48:07)
git-committer:
Jiri Svoboda <jiri@…> (2023-09-16 19:58:18)
Message:

loc_server_register() should be callable more than once (API only)

Now loc_server_register() returns a pointer to a loc_srv_t object,
that is then passed to loc_service_register() and
loc_service_add_to_cat().

Added loc_server_unregister() that unregisters the server
and frees the loc_srv_t object.

Updated all callers. The implementation, however, is a stub.
It is not actually possible to call loc_server_register() more
than once, yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/rfb/main.c

    r6a0b2cc r4c6fd56  
    11/*
    2  * Copyright (c) 2021 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * Copyright (c) 2013 Martin Sucha
    44 * All rights reserved.
     
    443443{
    444444        rfb_t rfb;
     445        loc_srv_t *srv;
    445446
    446447        log_init(NAME);
     
    482483        async_set_fallback_port_handler(client_connection, &rfb);
    483484
    484         errno_t rc = loc_server_register(NAME);
     485        errno_t rc = loc_server_register(NAME, &srv);
    485486        if (rc != EOK) {
    486487                printf("%s: Unable to register server.\n", NAME);
     
    497498        service_id_t service_id;
    498499
    499         rc = loc_service_register(service_name, &service_id);
     500        rc = loc_service_register(srv, service_name, &service_id);
    500501        if (rc != EOK) {
    501502                printf(NAME ": Unable to register service %s.\n", service_name);
     
    512513        }
    513514
    514         rc = loc_service_add_to_cat(service_id, ddev_cid);
     515        rc = loc_service_add_to_cat(srv, service_id, ddev_cid);
    515516        if (rc != EOK) {
    516517                fprintf(stderr, NAME ": Unable to add service to display device category.\n");
Note: See TracChangeset for help on using the changeset viewer.