Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset ec39720 in mainline


Ignore:
Timestamp:
2018-06-09T10:39:01Z (3 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
899342e, ed18e14
Parents:
931afbc
Message:

tmpfs_truncate must not fail when new size is zero

When zero size is passed to realloc and addr is not NULL, realloc
behaves like free and returns NULL. tmpfs_truncate must not consider
this an error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    r931afbc rec39720  
    597597
    598598        ht_link_t *hlp = hash_table_find(&nodes, &key);
    599 
    600599        if (!hlp)
    601600                return ENOENT;
     
    609608
    610609        void *newdata = realloc(nodep->data, size);
    611         if (!newdata)
     610        if (!newdata && size)
    612611                return ENOMEM;
    613612
Note: See TracChangeset for help on using the changeset viewer.