Changeset 241f1985 in mainline for uspace/lib/c/generic/async/client.c


Ignore:
Timestamp:
2019-08-31T10:45:17Z (6 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
102f641
Parents:
f92b315
git-author:
Matthieu Riolo <matthieu.riolo@…> (2019-08-23 22:04:34)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-31 10:45:17)
Message:

Correcting failure from previous merge

The commits from Michal Koutný from the branch system-daemon
where built on a old version of Helenos. Because of this
many types and API functions have changed. This commit
upgrades the merge code

File:
1 edited

Legend:

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

    rf92b315 r241f1985  
    9999#include <async.h>
    100100#include "../private/async.h"
    101 #include "../private/ns.h"
    102101#undef _LIBC_ASYNC_C_
    103102
     
    114113#include <stdbool.h>
    115114#include <stdlib.h>
     115#include <stdatomic.h>
    116116#include <mem.h>
    117 #include <stdlib.h>
    118117#include <macros.h>
    119118#include <as.h>
     
    174173    sysarg_t arg1, sysarg_t arg2, sysarg_t arg3)
    175174{
    176         async_sess_t *session = (async_sess_t *) malloc(sizeof(async_sess_t));
     175        async_sess_t *session = (async_sess_t *) calloc(1, sizeof(async_sess_t));
    177176
    178177        if (session != NULL) {
    179                 session->iface = 0;
    180178                session->mgmt = mgmt;
    181179                session->phone = phone;
     
    189187                list_initialize(&session->exch_list);
    190188                fibril_mutex_initialize(&session->mutex);
    191                 atomic_set(&session->refcnt, 0);
    192                 &session.exchanges = 0;
    193189        } else {
    194190                errno = ENOMEM;
     
    198194}
    199195
    200 int async_session_phone(async_sess_t *sess)
     196cap_phone_handle_t async_session_phone(async_sess_t *sess)
    201197{
    202198        return sess->phone;
     
    859855        }
    860856
    861         async_sess_t *sess = create_session(phone, mgmt, iface, arg2, arg3);
     857        async_sess_t *sess = create_session(phone, iface & IFACE_EXCHANGE_MASK, iface, arg2, arg3);
    862858        if (sess == NULL) {
    863859                ipc_hangup(phone);
    864860        }
     861        sess->iface = iface;
    865862
    866863        return sess;
     
    912909        if (rc != EOK) {
    913910                errno = rc;
    914                 free(sess);
    915911                return NULL;
    916912        }
    917913
    918         async_sess_t *sess = create_session(phone, mgmt, iface, arg2, arg3);
     914        async_sess_t *sess = create_session(phone, iface & IFACE_EXCHANGE_MASK, iface, arg2, arg3);
    919915        if (sess == NULL) {
    920916                ipc_hangup(phone);
    921917        }
     918        sess->iface = iface;
    922919
    923920        return sess;
Note: See TracChangeset for help on using the changeset viewer.