Changeset dc5c303 in mainline for uspace/lib/hound/src/protocol.c


Ignore:
Timestamp:
2023-12-28T13:59:23Z (15 months ago)
Author:
GitHub <noreply@…>
Children:
6b66de6b
Parents:
42c2e65 (diff), f87ff8e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
boba-buba <120932204+boba-buba@…> (2023-12-28 13:59:23)
git-committer:
GitHub <noreply@…> (2023-12-28 13:59:23)
Message:

Merge branch 'master' into topic/packet-capture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/hound/src/protocol.c

    r42c2e65 rdc5c303  
    11/*
     2 * Copyright (c) 2023 Jiri Svoboda
    23 * Copyright (c) 2012 Jan Vesely
    34 * All rights reserved.
     
    8485const char *HOUND_SERVICE = "audio/hound";
    8586
     87/** Server object */
     88static loc_srv_t *hound_srv;
     89
    8690/**
    8791 * Start a new audio session.
     
    730734errno_t hound_server_register(const char *name, service_id_t *id)
    731735{
     736        errno_t rc;
     737
    732738        if (!name || !id)
    733739                return EINVAL;
    734740
    735         errno_t ret = loc_server_register(name);
    736         if (ret != EOK)
    737                 return ret;
    738 
    739         return loc_service_register(HOUND_SERVICE, id);
     741        if (hound_srv != NULL)
     742                return EBUSY;
     743
     744        rc = loc_server_register(name, &hound_srv);
     745        if (rc != EOK)
     746                return rc;
     747
     748        rc = loc_service_register(hound_srv, HOUND_SERVICE, id);
     749        if (rc != EOK) {
     750                loc_server_unregister(hound_srv);
     751                return rc;
     752        }
     753
     754        return EOK;
    740755}
    741756
     
    746761void hound_server_unregister(service_id_t id)
    747762{
    748         loc_service_unregister(id);
     763        loc_service_unregister(hound_srv, id);
     764        loc_server_unregister(hound_srv);
    749765}
    750766
Note: See TracChangeset for help on using the changeset viewer.