Changeset 241f1985 in mainline for uspace/lib/c/generic/async/client.c
- Timestamp:
- 2019-08-31T10:45:17Z (6 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/async/client.c
rf92b315 r241f1985 99 99 #include <async.h> 100 100 #include "../private/async.h" 101 #include "../private/ns.h"102 101 #undef _LIBC_ASYNC_C_ 103 102 … … 114 113 #include <stdbool.h> 115 114 #include <stdlib.h> 115 #include <stdatomic.h> 116 116 #include <mem.h> 117 #include <stdlib.h>118 117 #include <macros.h> 119 118 #include <as.h> … … 174 173 sysarg_t arg1, sysarg_t arg2, sysarg_t arg3) 175 174 { 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)); 177 176 178 177 if (session != NULL) { 179 session->iface = 0;180 178 session->mgmt = mgmt; 181 179 session->phone = phone; … … 189 187 list_initialize(&session->exch_list); 190 188 fibril_mutex_initialize(&session->mutex); 191 atomic_set(&session->refcnt, 0);192 &session.exchanges = 0;193 189 } else { 194 190 errno = ENOMEM; … … 198 194 } 199 195 200 int async_session_phone(async_sess_t *sess)196 cap_phone_handle_t async_session_phone(async_sess_t *sess) 201 197 { 202 198 return sess->phone; … … 859 855 } 860 856 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); 862 858 if (sess == NULL) { 863 859 ipc_hangup(phone); 864 860 } 861 sess->iface = iface; 865 862 866 863 return sess; … … 912 909 if (rc != EOK) { 913 910 errno = rc; 914 free(sess);915 911 return NULL; 916 912 } 917 913 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); 919 915 if (sess == NULL) { 920 916 ipc_hangup(phone); 921 917 } 918 sess->iface = iface; 922 919 923 920 return sess;
Note:
See TracChangeset
for help on using the changeset viewer.