Changeset 01900b6 in mainline for uspace/lib/c/generic/loc.c


Ignore:
Timestamp:
2020-01-21T15:10:26Z (5 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/generic/loc.c

    rf8fb03b r01900b6  
    153153                                loc_supp_block_sess =
    154154                                    service_connect_blocking(SERVICE_LOC,
    155                                     INTERFACE_LOC_SUPPLIER, 0);
     155                                    INTERFACE_LOC_SUPPLIER, 0, NULL);
    156156                }
    157157
     
    172172                                loc_cons_block_sess =
    173173                                    service_connect_blocking(SERVICE_LOC,
    174                                     INTERFACE_LOC_CONSUMER, 0);
     174                                    INTERFACE_LOC_CONSUMER, 0, NULL);
    175175                }
    176176
     
    202202                        loc_supplier_sess =
    203203                            service_connect(SERVICE_LOC,
    204                             INTERFACE_LOC_SUPPLIER, 0);
     204                            INTERFACE_LOC_SUPPLIER, 0, NULL);
    205205
    206206                fibril_mutex_unlock(&loc_supplier_mutex);
     
    216216                        loc_consumer_sess =
    217217                            service_connect(SERVICE_LOC,
    218                             INTERFACE_LOC_CONSUMER, 0);
     218                            INTERFACE_LOC_CONSUMER, 0, NULL);
    219219
    220220                fibril_mutex_unlock(&loc_consumer_mutex);
     
    567567
    568568        if (flags & IPC_FLAG_BLOCKING)
    569                 sess = service_connect_blocking(SERVICE_LOC, iface, handle);
     569                sess = service_connect_blocking(SERVICE_LOC, iface, handle, NULL);
    570570        else
    571                 sess = service_connect(SERVICE_LOC, iface, handle);
     571                sess = service_connect(SERVICE_LOC, iface, handle, NULL);
    572572
    573573        return sess;
Note: See TracChangeset for help on using the changeset viewer.