Changeset 1c6c3e1d in mainline for uspace/srv/test/chardev-test/main.c
- Timestamp:
- 2023-10-22T17:55:33Z (15 months ago)
- Branches:
- ticket/834-toolchain-update
- Children:
- 350ec74
- Parents:
- 315d487 (diff), 133461c (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/test/chardev-test/main.c
r315d487 r1c6c3e1d 1 1 /* 2 * Copyright (c) 20 17Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 118 118 { 119 119 errno_t rc; 120 loc_srv_t *srv; 120 121 121 122 printf("%s: Character device test service\n", NAME); 122 123 async_set_fallback_port_handler(chardev_test_connection, NULL); 123 124 124 rc = loc_server_register(NAME );125 rc = loc_server_register(NAME, &srv); 125 126 if (rc != EOK) { 126 127 printf("%s: Failed registering server.: %s\n", NAME, str_error(rc)); … … 140 141 partialx_srvs.sarg = NULL; 141 142 142 rc = loc_service_register(SERVICE_NAME_CHARDEV_TEST_SMALLX, &smallx_svc_id); 143 rc = loc_service_register(srv, SERVICE_NAME_CHARDEV_TEST_SMALLX, 144 &smallx_svc_id); 143 145 if (rc != EOK) { 144 146 printf("%s: Failed registering service.: %s\n", NAME, str_error(rc)); 145 return rc; 146 } 147 148 rc = loc_service_register(SERVICE_NAME_CHARDEV_TEST_LARGEX, &largex_svc_id); 147 goto error; 148 } 149 150 rc = loc_service_register(srv, SERVICE_NAME_CHARDEV_TEST_LARGEX, 151 &largex_svc_id); 149 152 if (rc != EOK) { 150 153 printf("%s: Failed registering service.: %s\n", NAME, str_error(rc)); 151 return rc; 152 } 153 154 rc = loc_service_register(SERVICE_NAME_CHARDEV_TEST_PARTIALX, &partialx_svc_id); 154 goto error; 155 } 156 157 rc = loc_service_register(srv, SERVICE_NAME_CHARDEV_TEST_PARTIALX, 158 &partialx_svc_id); 155 159 if (rc != EOK) { 156 160 printf("%s: Failed registering service.: %s\n", NAME, str_error(rc)); 157 return rc;161 goto error; 158 162 } 159 163 … … 164 168 /* Not reached */ 165 169 return 0; 170 error: 171 if (smallx_svc_id != 0) 172 loc_service_unregister(srv, smallx_svc_id); 173 if (largex_svc_id != 0) 174 loc_service_unregister(srv, largex_svc_id); 175 if (partialx_svc_id != 0) 176 loc_service_unregister(srv, partialx_svc_id); 177 loc_server_unregister(srv); 178 return rc; 166 179 } 167 180
Note:
See TracChangeset
for help on using the changeset viewer.