Changeset a99cbc1e in mainline


Ignore:
Timestamp:
2017-12-08T21:03:35Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e172429
Parents:
c8211849
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 00:45:14)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 21:03:35)
Message:

async_connect_me_to_internal() should return cap handle separately from error code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async.c

    rc8211849 ra99cbc1e  
    21232123
    21242124static int async_connect_me_to_internal(int phone, sysarg_t arg1, sysarg_t arg2,
    2125     sysarg_t arg3, sysarg_t arg4)
     2125    sysarg_t arg3, sysarg_t arg4, int *out_phone)
    21262126{
    21272127        ipc_call_t result;
     2128       
     2129        // XXX: Workaround for GCC's inability to infer association between
     2130        // rc == EOK and *out_phone being assigned.
     2131        *out_phone = -1;
    21282132       
    21292133        amsg_t *msg = amsg_create();
     
    21432147                return rc;
    21442148       
    2145         return (int) IPC_GET_ARG5(result);
     2149        *out_phone = (int) IPC_GET_ARG5(result);
     2150        return EOK;
    21462151}
    21472152
     
    21732178        }
    21742179       
    2175         int phone = async_connect_me_to_internal(exch->phone, arg1, arg2, arg3,
    2176             0);
    2177         if (phone < 0) {
    2178                 errno = phone;
     2180        int phone;
     2181        int rc = async_connect_me_to_internal(exch->phone, arg1, arg2, arg3,
     2182            0, &phone);
     2183        if (rc != EOK) {
     2184                errno = rc;
    21792185                free(sess);
    21802186                return NULL;
     
    22252231        }
    22262232       
    2227         int phone = async_connect_me_to_internal(exch->phone, iface, arg2,
    2228             arg3, 0);
    2229         if (phone < 0) {
    2230                 errno = phone;
     2233        int phone;
     2234        int rc = async_connect_me_to_internal(exch->phone, iface, arg2,
     2235            arg3, 0, &phone);
     2236        if (rc != EOK) {
     2237                errno = rc;
    22312238                free(sess);
    22322239                return NULL;
     
    22952302        }
    22962303       
    2297         int phone = async_connect_me_to_internal(exch->phone, arg1, arg2, arg3,
    2298             IPC_FLAG_BLOCKING);
    2299        
    2300         if (phone < 0) {
    2301                 errno = phone;
     2304        int phone;
     2305        int rc = async_connect_me_to_internal(exch->phone, arg1, arg2, arg3,
     2306            IPC_FLAG_BLOCKING, &phone);
     2307       
     2308        if (rc != EOK) {
     2309                errno = rc;
    23022310                free(sess);
    23032311                return NULL;
     
    23482356        }
    23492357       
    2350         int phone = async_connect_me_to_internal(exch->phone, iface, arg2,
    2351             arg3, IPC_FLAG_BLOCKING);
    2352         if (phone < 0) {
    2353                 errno = phone;
     2358        int phone;
     2359        int rc = async_connect_me_to_internal(exch->phone, iface, arg2,
     2360            arg3, IPC_FLAG_BLOCKING, &phone);
     2361        if (rc != EOK) {
     2362                errno = rc;
    23542363                free(sess);
    23552364                return NULL;
     
    25022511                } else if (mgmt == EXCHANGE_PARALLEL) {
    25032512                        int phone;
     2513                        int rc;
    25042514                       
    25052515                retry:
     
    25072517                         * Make a one-time attempt to connect a new data phone.
    25082518                         */
    2509                         phone = async_connect_me_to_internal(sess->phone, sess->arg1,
    2510                             sess->arg2, sess->arg3, 0);
    2511                         if (phone >= 0) {
     2519                        rc = async_connect_me_to_internal(sess->phone, sess->arg1,
     2520                            sess->arg2, sess->arg3, 0, &phone);
     2521                        if (rc == EOK) {
    25122522                                exch = (async_exch_t *) malloc(sizeof(async_exch_t));
    25132523                                if (exch != NULL) {
Note: See TracChangeset for help on using the changeset viewer.