Changeset 4c6fd56 in mainline for uspace/lib/hound/src/protocol.c
- Timestamp:
- 2023-09-16T19:58:18Z (16 months ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/hound/src/protocol.c
r6a0b2cc r4c6fd56 1 1 /* 2 * Copyright (c) 2023 Jiri Svoboda 2 3 * Copyright (c) 2012 Jan Vesely 3 4 * All rights reserved. … … 84 85 const char *HOUND_SERVICE = "audio/hound"; 85 86 87 /** Server object */ 88 static loc_srv_t *hound_srv; 89 86 90 /** 87 91 * Start a new audio session. … … 730 734 errno_t hound_server_register(const char *name, service_id_t *id) 731 735 { 736 errno_t rc; 737 732 738 if (!name || !id) 733 739 return EINVAL; 734 740 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; 740 755 } 741 756 … … 746 761 void hound_server_unregister(service_id_t id) 747 762 { 748 loc_service_unregister(id); 763 loc_service_unregister(hound_srv, id); 764 loc_server_unregister(hound_srv); 749 765 } 750 766
Note:
See TracChangeset
for help on using the changeset viewer.