Changeset 4c6fd56 in mainline for uspace/srv/taskmon/taskmon.c


Ignore:
Timestamp:
2023-09-16T19:58:18Z (18 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/taskmon/taskmon.c

    r6a0b2cc r4c6fd56  
    11/*
    2  * Copyright (c) 2013 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    136136int main(int argc, char *argv[])
    137137{
     138        loc_srv_t *srv;
     139
    138140        printf("%s: Task Monitoring Service\n", NAME);
    139141
     
    150152        async_set_fallback_port_handler(corecfg_client_conn, NULL);
    151153
    152         errno_t rc = loc_server_register(NAME);
     154        errno_t rc = loc_server_register(NAME, &srv);
    153155        if (rc != EOK) {
    154156                printf("%s: Failed registering server: %s.\n",
     
    158160
    159161        service_id_t sid;
    160         rc = loc_service_register(SERVICE_NAME_CORECFG, &sid);
     162        rc = loc_service_register(srv, SERVICE_NAME_CORECFG, &sid);
    161163        if (rc != EOK) {
     164                loc_server_unregister(srv);
    162165                printf("%s: Failed registering service: %s.\n",
    163166                    NAME, str_error(rc));
Note: See TracChangeset for help on using the changeset viewer.