Changeset 622e7c9 in mainline


Ignore:
Timestamp:
2020-05-05T16:15:09Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ccbd2e1
Parents:
698ce34c
Message:

async_hangup() should just always succeed

There is no reason why this should fail in a valid program. If you e.g.
hang up the phone manually and then call async_hangup(), your bad.
We are washing our hands.

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/hid/usbhid/mouse/mousedev.c

    r698ce34c r622e7c9  
    422422
    423423        /* Hangup session to the console */
    424         if (mouse_dev->mouse_sess != NULL) {
    425                 const errno_t ret = async_hangup(mouse_dev->mouse_sess);
    426                 if (ret != EOK)
    427                         usb_log_warning("Failed to hang up mouse session: "
    428                             "%p, %s.\n", mouse_dev->mouse_sess, str_error(ret));
    429         }
     424        if (mouse_dev->mouse_sess != NULL)
     425                async_hangup(mouse_dev->mouse_sess);
    430426
    431427        free(mouse_dev->buttons);
  • uspace/lib/c/generic/async/client.c

    r698ce34c r622e7c9  
    10501050}
    10511051
    1052 static errno_t async_hangup_internal(cap_phone_handle_t phone)
    1053 {
    1054         return ipc_hangup(phone);
     1052static void async_hangup_internal(cap_phone_handle_t phone)
     1053{
     1054        (void) ipc_hangup(phone);
    10551055}
    10561056
     
    10581058 *
    10591059 * @param sess Session to hung up.
    1060  *
    1061  * @return Zero on success or an error code.
    1062  *
    1063  */
    1064 errno_t async_hangup(async_sess_t *sess)
     1060 */
     1061void async_hangup(async_sess_t *sess)
    10651062{
    10661063        async_exch_t *exch;
     
    10711068        assert(sess->exchanges == 0);
    10721069
    1073         errno_t rc = async_hangup_internal(sess->phone);
     1070        async_hangup_internal(sess->phone);
    10741071
    10751072        while (!list_empty(&sess->exch_list)) {
     
    10871084
    10881085        fibril_mutex_unlock(&async_sess_mutex);
    1089 
    1090         return rc;
    10911086}
    10921087
  • uspace/lib/c/include/async.h

    r698ce34c r622e7c9  
    282282extern errno_t async_connect_to_me(async_exch_t *, iface_t, sysarg_t, sysarg_t);
    283283
    284 extern errno_t async_hangup(async_sess_t *);
     284extern void async_hangup(async_sess_t *);
    285285
    286286extern async_exch_t *async_exchange_begin(async_sess_t *);
Note: See TracChangeset for help on using the changeset viewer.