Changeset c3f95d8 in mainline for uspace/lib


Ignore:
Timestamp:
2011-03-13T11:39:00Z (14 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5e3eea10
Parents:
f8c60f5 (diff), c1a5d8d (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:

Merged mainline changes

Location:
uspace/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/block/libblock.c

    rf8c60f5 rc3f95d8  
    412412        l = hash_table_find(&cache->block_hash, &key);
    413413        if (l) {
     414found:
    414415                /*
    415416                 * We found the block in the cache.
     
    494495                                        fibril_mutex_unlock(&b->lock);
    495496                                        goto retry;
     497                                }
     498                                l = hash_table_find(&cache->block_hash, &key);
     499                                if (l) {
     500                                        /*
     501                                         * Someone else must have already
     502                                         * instantiated the block while we were
     503                                         * not holding the cache lock.
     504                                         * Leave the recycled block on the
     505                                         * freelist and continue as if we
     506                                         * found the block of interest during
     507                                         * the first try.
     508                                         */
     509                                        fibril_mutex_unlock(&b->lock);
     510                                        goto found;
    496511                                }
    497512
  • uspace/lib/c/generic/loader.c

    rf8c60f5 rc3f95d8  
    160160        int rc = async_data_write_start(ldr->phone_id, (void *) pa, pa_len);
    161161        if (rc != EOK) {
     162                free(pa);
    162163                async_wait_for(req, NULL);
    163164                return rc;
  • uspace/lib/c/generic/vfs/vfs.c

    rf8c60f5 rc3f95d8  
    6969        char *ncwd_path;
    7070        char *ncwd_path_nc;
     71        size_t total_size;
    7172
    7273        fibril_mutex_lock(&cwd_mutex);
     
    7778                        return NULL;
    7879                }
    79                 ncwd_path_nc = malloc(cwd_size + 1 + size + 1);
     80                total_size = cwd_size + 1 + size + 1;
     81                ncwd_path_nc = malloc(total_size);
    8082                if (!ncwd_path_nc) {
    8183                        fibril_mutex_unlock(&cwd_mutex);
    8284                        return NULL;
    8385                }
    84                 str_cpy(ncwd_path_nc, cwd_size + 1 + size + 1, cwd_path);
     86                str_cpy(ncwd_path_nc, total_size, cwd_path);
    8587                ncwd_path_nc[cwd_size] = '/';
    8688                ncwd_path_nc[cwd_size + 1] = '\0';
    8789        } else {
    88                 ncwd_path_nc = malloc(size + 1);
     90                total_size = size + 1;
     91                ncwd_path_nc = malloc(total_size);
    8992                if (!ncwd_path_nc) {
    9093                        fibril_mutex_unlock(&cwd_mutex);
     
    9396                ncwd_path_nc[0] = '\0';
    9497        }
    95         str_append(ncwd_path_nc, cwd_size + 1 + size + 1, path);
     98        str_append(ncwd_path_nc, total_size, path);
    9699        ncwd_path = canonify(ncwd_path_nc, retlen);
    97100        if (!ncwd_path) {
Note: See TracChangeset for help on using the changeset viewer.