Ignore:
File:
1 edited

Legend:

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

    rca48672 rfafb8e5  
    11/*
    2  * Copyright (c) 2025 Jiri Svoboda
    32 * Copyright (c) 2012 Jan Vesely
    43 * All rights reserved.
     
    8584const char *HOUND_SERVICE = "audio/hound";
    8685
    87 /** Server object */
    88 static loc_srv_t *hound_srv;
    89 
    9086/**
    9187 * Start a new audio session.
     
    398394        void *sink;
    399395
    400         /* Accept connection if there is a valid iface */
     396        /* Accept connection if there is a valid iface*/
    401397        if (server_iface) {
    402398                async_accept_0(icall);
     
    551547                        ret = async_data_write_accept(&source, true, 0, 0, 0,
    552548                            0);
    553                         /* read sink name */
     549                        /*read sink name */
    554550                        if (ret == EOK)
    555551                                ret = async_data_write_accept(&sink,
     
    615611                case IPC_M_HOUND_STREAM_EXIT:
    616612                case IPC_M_HOUND_STREAM_DRAIN:
    617                         /* Stream exit/drain is only allowed in stream context */
     613                        /* Stream exit/drain is only allowed in stream context*/
    618614                        async_answer_0(&call, EINVAL);
    619615                        break;
     
    734730errno_t hound_server_register(const char *name, service_id_t *id)
    735731{
    736         errno_t rc;
    737 
    738732        if (!name || !id)
    739733                return EINVAL;
    740734
    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,
    749             fallback_port_id, id);
    750         if (rc != EOK) {
    751                 loc_server_unregister(hound_srv);
    752                 return rc;
    753         }
    754 
    755         return EOK;
     735        errno_t ret = loc_server_register(name);
     736        if (ret != EOK)
     737                return ret;
     738
     739        return loc_service_register(HOUND_SERVICE, id);
    756740}
    757741
     
    762746void hound_server_unregister(service_id_t id)
    763747{
    764         loc_service_unregister(hound_srv, id);
    765         loc_server_unregister(hound_srv);
     748        loc_service_unregister(id);
    766749}
    767750
Note: See TracChangeset for help on using the changeset viewer.