Changeset 46577995 in mainline for uspace/srv/net/udp/assoc.c


Ignore:
Timestamp:
2018-01-04T20:50:52Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
e211ea04
Parents:
facacc71
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:47:53)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:50:52)
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

After this commit, HelenOS is free of code that mixes error codes with non-error
values on the assumption that error codes are negative.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/udp/assoc.c

    rfacacc71 r46577995  
    5656
    5757static udp_assoc_t *udp_assoc_find_ref(inet_ep2_t *);
    58 static int udp_assoc_queue_msg(udp_assoc_t *, inet_ep2_t *, udp_msg_t *);
     58static errno_t udp_assoc_queue_msg(udp_assoc_t *, inet_ep2_t *, udp_msg_t *);
    5959
    6060/** Initialize associations. */
    61 int udp_assocs_init(void)
    62 {
    63         int rc;
     61errno_t udp_assocs_init(void)
     62{
     63        errno_t rc;
    6464
    6565        rc = amap_create(&amap);
     
    182182 * Add association to the association map.
    183183 */
    184 int udp_assoc_add(udp_assoc_t *assoc)
     184errno_t udp_assoc_add(udp_assoc_t *assoc)
    185185{
    186186        inet_ep2_t aepp;
    187         int rc;
     187        errno_t rc;
    188188
    189189        udp_assoc_addref(assoc);
     
    242242 *                      EIO if no route to destination exists
    243243 */
    244 int udp_assoc_send(udp_assoc_t *assoc, inet_ep_t *remote, udp_msg_t *msg)
     244errno_t udp_assoc_send(udp_assoc_t *assoc, inet_ep_t *remote, udp_msg_t *msg)
    245245{
    246246        udp_pdu_t *pdu;
    247247        inet_ep2_t epp;
    248         int rc;
     248        errno_t rc;
    249249
    250250        log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_send(%p, %p, %p)",
     
    302302 * Pull one message from the association's receive queue.
    303303 */
    304 int udp_assoc_recv(udp_assoc_t *assoc, udp_msg_t **msg, inet_ep_t *remote)
     304errno_t udp_assoc_recv(udp_assoc_t *assoc, udp_msg_t **msg, inet_ep_t *remote)
    305305{
    306306        link_t *link;
     
    341341{
    342342        udp_assoc_t *assoc;
    343         int rc;
     343        errno_t rc;
    344344
    345345        log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_received(%p, %p)", repp, msg);
     
    380380}
    381381
    382 static int udp_assoc_queue_msg(udp_assoc_t *assoc, inet_ep2_t *epp,
     382static errno_t udp_assoc_queue_msg(udp_assoc_t *assoc, inet_ep2_t *epp,
    383383    udp_msg_t *msg)
    384384{
     
    416416static udp_assoc_t *udp_assoc_find_ref(inet_ep2_t *epp)
    417417{
    418         int rc;
     418        errno_t rc;
    419419        void *arg;
    420420        udp_assoc_t *assoc;
Note: See TracChangeset for help on using the changeset viewer.