Changeset b910455 in mainline for uspace/lib/c/generic


Ignore:
Timestamp:
2011-04-07T09:46:11Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6639ae1
Parents:
f6bffee (diff), 8e80d3f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Location:
uspace/lib/c/generic
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/adt/measured_strings.c

    rf6bffee rb910455  
    7474        new->length = length;
    7575        new->value = ((uint8_t *) new) + sizeof(measured_string_t);
    76         // append terminating zero explicitly - to be safe
     76        /* Append terminating zero explicitly - to be safe */
    7777        memcpy(new->value, string, new->length);
    7878        new->value[new->length] = '\0';
  • uspace/lib/c/generic/async.c

    rf6bffee rb910455  
    15781578 */
    15791579int
    1580 async_data_read_start_flexible(int phoneid, void *dst, size_t size, int flags)
     1580async_data_read_start_generic(int phoneid, void *dst, size_t size, int flags)
    15811581{
    15821582        return async_req_3_0(phoneid, IPC_M_DATA_READ, (sysarg_t) dst,
     
    16771677 */
    16781678int
    1679 async_data_write_start_flexible(int phoneid, const void *src, size_t size,
     1679async_data_write_start_generic(int phoneid, const void *src, size_t size,
    16801680    int flags)
    16811681{
  • uspace/lib/c/generic/devman.c

    rf6bffee rb910455  
    147147                ret = devman_send_match_id(phone, match_id);
    148148                if (ret != EOK) {
    149                         printf("Driver failed to send match id, error %d\n",
    150                             ret);
    151149                        return ret;
    152150                }
     
    195193        }
    196194       
    197         devman_send_match_ids(phone, match_ids);
    198        
    199         async_wait_for(req, &retval);
    200        
    201         async_serialize_end();
    202        
     195        int match_ids_rc = devman_send_match_ids(phone, match_ids);
     196       
     197        async_wait_for(req, &retval);
     198       
     199        async_serialize_end();
     200       
     201        /* Prefer the answer to DEVMAN_ADD_FUNCTION in case of errors. */
     202        if ((match_ids_rc != EOK) && (retval == EOK)) {
     203                retval = match_ids_rc;
     204        }
     205
    203206        if (retval == EOK)
    204207                fun_handle = (int) IPC_GET_ARG1(answer);
     
    326329}
    327330
     331int devman_device_get_handle_by_class(const char *classname,
     332    const char *devname, devman_handle_t *handle, unsigned int flags)
     333{
     334        int phone = devman_get_phone(DEVMAN_CLIENT, flags);
     335
     336        if (phone < 0)
     337                return phone;
     338
     339        async_serialize_start();
     340
     341        ipc_call_t answer;
     342        aid_t req = async_send_1(phone, DEVMAN_DEVICE_GET_HANDLE_BY_CLASS,
     343            flags, &answer);
     344
     345        sysarg_t retval = async_data_write_start(phone, classname,
     346            str_size(classname));
     347        if (retval != EOK) {
     348                async_wait_for(req, NULL);
     349                async_serialize_end();
     350                return retval;
     351        }
     352        retval = async_data_write_start(phone, devname,
     353            str_size(devname));
     354        if (retval != EOK) {
     355                async_wait_for(req, NULL);
     356                async_serialize_end();
     357                return retval;
     358        }
     359
     360        async_wait_for(req, &retval);
     361
     362        async_serialize_end();
     363
     364        if (retval != EOK) {
     365                if (handle != NULL)
     366                        *handle = (devman_handle_t) -1;
     367                return retval;
     368        }
     369
     370        if (handle != NULL)
     371                *handle = (devman_handle_t) IPC_GET_ARG1(answer);
     372
     373        return retval;
     374}
     375
    328376
    329377/** @}
  • uspace/lib/c/generic/net/packet.c

    rf6bffee rb910455  
    190190                }
    191191        }
    192         gpm_destroy(&pm_globals.packet_map);
     192        gpm_destroy(&pm_globals.packet_map, free);
    193193        /* leave locked */
    194194}
  • uspace/lib/c/generic/net/socket_client.c

    rf6bffee rb910455  
    749749        dyn_fifo_destroy(&socket->received);
    750750        dyn_fifo_destroy(&socket->accepted);
    751         sockets_exclude(socket_get_sockets(), socket->socket_id);
     751        sockets_exclude(socket_get_sockets(), socket->socket_id, free);
    752752}
    753753
  • uspace/lib/c/generic/vfs/vfs.c

    rf6bffee rb910455  
    378378       
    379379        req = async_send_1(vfs_phone, VFS_IN_READ, fildes, &answer);
    380         rc = async_data_read_start_flexible(vfs_phone, (void *) buf, nbyte,
     380        rc = async_data_read_start_generic(vfs_phone, (void *) buf, nbyte,
    381381            IPC_XF_RESTRICT);
    382382        if (rc != EOK) {
     
    408408       
    409409        req = async_send_1(vfs_phone, VFS_IN_WRITE, fildes, &answer);
    410         rc = async_data_write_start_flexible(vfs_phone, (void *) buf, nbyte,
     410        rc = async_data_write_start_generic(vfs_phone, (void *) buf, nbyte,
    411411            IPC_XF_RESTRICT);
    412412        if (rc != EOK) {
     
    758758{
    759759        struct stat stat;
    760         int rc;
    761 
    762         rc = fstat(fildes, &stat);
    763 
     760       
     761        int rc = fstat(fildes, &stat);
     762        if (rc != 0)
     763                return rc;
     764       
    764765        if (!stat.device)
    765766                return -1;
Note: See TracChangeset for help on using the changeset viewer.