Changeset 01900b6 in mainline for uspace/lib/c/include/ns.h


Ignore:
Timestamp:
2020-01-21T15:10:26Z (4 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
51da086
Parents:
f8fb03b
Message:

Use an optional output argument instead of errno to propagate the error

The use of errno is troublesome in all other than top-level library
functions since the value in errno might get overwritten by subsequent
inner calls on the error path (e.g. cleanup, deallocation, etc.). The
optional output argument makes it possible to explicitly ignore the
error code if it is not needed, but still to pass it reliably back to
the original caller.

This change affecs async_connect_me_to(),
async_connect_me_to_blocking(), async_connect_kbox(), service_connect(),
service_connect_blocking() and loader_connect().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/ns.h

    rf8fb03b r01900b6  
    4343    void *);
    4444extern errno_t service_register_broker(service_t, async_port_handler_t, void *);
    45 extern async_sess_t *service_connect(service_t, iface_t, sysarg_t);
    46 extern async_sess_t *service_connect_blocking(service_t, iface_t, sysarg_t);
     45extern async_sess_t *service_connect(service_t, iface_t, sysarg_t, errno_t *);
     46extern async_sess_t *service_connect_blocking(service_t, iface_t, sysarg_t,
     47    errno_t *);
    4748
    4849extern errno_t ns_ping(void);
    4950extern errno_t ns_intro(task_id_t);
    50 extern async_sess_t *ns_session_get(void);
     51extern async_sess_t *ns_session_get(errno_t *);
    5152
    5253#endif
Note: See TracChangeset for help on using the changeset viewer.