Changeset dc5c303 in mainline for uspace/srv/net/slip/slip.c
- Timestamp:
- 2023-12-28T13:59:23Z (14 months ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/slip/slip.c
r42c2e65 rdc5c303 1 1 /* 2 * Copyright (c) 202 1Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * Copyright (c) 2013 Jakub Jermar 4 4 * All rights reserved. … … 307 307 chardev_t *chardev_out = NULL; 308 308 fid_t fid; 309 loc_srv_t *srv; 309 310 errno_t rc; 310 311 … … 314 315 async_set_fallback_port_handler(slip_client_conn, NULL); 315 316 316 rc = loc_server_register(NAME );317 rc = loc_server_register(NAME, &srv); 317 318 if (rc != EOK) { 318 319 log_msg(LOG_DEFAULT, LVL_ERROR, … … 323 324 rc = loc_service_get_id(svcstr, &svcid, 0); 324 325 if (rc != EOK) { 326 loc_server_unregister(srv); 325 327 log_msg(LOG_DEFAULT, LVL_ERROR, 326 328 "Failed getting ID for service %s", svcstr); … … 330 332 rc = loc_category_get_id(CAT_IPLINK, &iplinkcid, 0); 331 333 if (rc != EOK) { 334 loc_server_unregister(srv); 332 335 log_msg(LOG_DEFAULT, LVL_ERROR, 333 336 "Failed to get category ID for %s", … … 342 345 sess_out = loc_service_connect(svcid, INTERFACE_DDF, 0); 343 346 if (!sess_out) { 347 loc_server_unregister(srv); 344 348 log_msg(LOG_DEFAULT, LVL_ERROR, 345 349 "Failed to connect to service %s (ID=%d)", … … 350 354 rc = chardev_open(sess_out, &chardev_out); 351 355 if (rc != EOK) { 356 loc_server_unregister(srv); 352 357 log_msg(LOG_DEFAULT, LVL_ERROR, 353 358 "Failed opening character device."); … … 373 378 } 374 379 375 rc = loc_service_register( linkstr, &linksid);380 rc = loc_service_register(srv, linkstr, &linksid); 376 381 if (rc != EOK) { 377 382 log_msg(LOG_DEFAULT, LVL_ERROR, … … 381 386 } 382 387 383 rc = loc_service_add_to_cat(linksid, iplinkcid); 384 if (rc != EOK) { 388 rc = loc_service_add_to_cat(srv, linksid, iplinkcid); 389 if (rc != EOK) { 390 loc_service_unregister(srv, linksid); 385 391 log_msg(LOG_DEFAULT, LVL_ERROR, 386 392 "Failed to add service %d (%s) to category %d (%s).", … … 401 407 402 408 fail: 409 loc_server_unregister(srv); 403 410 chardev_close(chardev_out); 404 411 if (sess_out)
Note:
See TracChangeset
for help on using the changeset viewer.