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


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/generic/devman.c

    rf8fb03b r01900b6  
    8989                                devman_driver_block_sess =
    9090                                    service_connect_blocking(SERVICE_DEVMAN,
    91                                     INTERFACE_DDF_DRIVER, 0);
     91                                    INTERFACE_DDF_DRIVER, 0, NULL);
    9292                }
    9393
     
    108108                                devman_client_block_sess =
    109109                                    service_connect_blocking(SERVICE_DEVMAN,
    110                                     INTERFACE_DDF_CLIENT, 0);
     110                                    INTERFACE_DDF_CLIENT, 0, NULL);
    111111                }
    112112
     
    138138                        devman_driver_sess =
    139139                            service_connect(SERVICE_DEVMAN,
    140                             INTERFACE_DDF_DRIVER, 0);
     140                            INTERFACE_DDF_DRIVER, 0, NULL);
    141141
    142142                fibril_mutex_unlock(&devman_driver_mutex);
     
    152152                        devman_client_sess =
    153153                            service_connect(SERVICE_DEVMAN,
    154                             INTERFACE_DDF_CLIENT, 0);
     154                            INTERFACE_DDF_CLIENT, 0, NULL);
    155155
    156156                fibril_mutex_unlock(&devman_client_mutex);
     
    292292        if (flags & IPC_FLAG_BLOCKING)
    293293                sess = service_connect_blocking(SERVICE_DEVMAN,
    294                     INTERFACE_DEVMAN_DEVICE, handle);
     294                    INTERFACE_DEVMAN_DEVICE, handle, NULL);
    295295        else
    296296                sess = service_connect(SERVICE_DEVMAN,
    297                     INTERFACE_DEVMAN_DEVICE, handle);
     297                    INTERFACE_DEVMAN_DEVICE, handle, NULL);
    298298
    299299        return sess;
     
    350350        if (flags & IPC_FLAG_BLOCKING)
    351351                sess = service_connect_blocking(SERVICE_DEVMAN,
    352                     INTERFACE_DEVMAN_PARENT, handle);
     352                    INTERFACE_DEVMAN_PARENT, handle, NULL);
    353353        else
    354                 sess = service_connect_blocking(SERVICE_DEVMAN,
    355                     INTERFACE_DEVMAN_PARENT, handle);
     354                sess = service_connect(SERVICE_DEVMAN,
     355                    INTERFACE_DEVMAN_PARENT, handle, NULL);
    356356
    357357        return sess;
Note: See TracChangeset for help on using the changeset viewer.