~ubuntu-branches/ubuntu/lucid/xenomai/lucid

« back to all changes in this revision

Viewing changes to src/skins/native/heap.c

  • Committer: Bazaar Package Importer
  • Author(s): Andres Rodriguez
  • Date: 2009-06-24 22:17:01 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090624221701-mwnah8aj90zmp6uj
Tags: 2.4.8-2ubuntu1
* Merge from debian unstable (LP: #391918), remaining changes:
  - Add lpia to supported architectures.
  - debian/rules: Create file for debhelper to pick up, use debhelper to
    install it.
  - debian/libxenomai1.dirs: Do not create directory.
  - debian/libxenomai1.preinst: Remove symlink on upgrade, remove old udev.
    rule unless modified in which case move to new name.
  - debian/libxenomai1.postinst: Do not create symlink.
  - debian/libxenomai1.postrm: No symlink to remove.
  - Bump build-depend on debhelper to install udev rules into
    /lib/udev/rules.d, add Breaks on udev to get correct version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
                /* If the mapping fails, make sure we don't leave a dandling
82
82
                   heap in kernel space -- remove it. */
83
83
                XENOMAI_SKINCALL1(__native_muxid, __native_heap_delete, &ph);
 
84
 
84
85
        return err;
85
86
}
86
87
 
113
114
{
114
115
        int err;
115
116
 
116
 
        err = __real_munmap(heap->mapbase, heap->mapsize);
117
 
 
118
 
        if (err == -1)
119
 
                err = -errno;
120
 
 
121
 
        if (!err)
122
 
                err =
123
 
                    XENOMAI_SKINCALL1(__native_muxid, __native_heap_delete,
124
 
                                      heap);
125
 
 
126
 
        /* If the deletion fails, there is likely something fishy about
127
 
           this heap descriptor, so we'd better clean it up anyway so
128
 
           that it could not be further used. */
 
117
        err = XENOMAI_SKINCALL1(__native_muxid, __native_heap_delete, heap);
 
118
        if (err)
 
119
                return err;
129
120
 
130
121
        heap->opaque = XN_NO_HANDLE;
131
122
        heap->mapbase = NULL;
132
123
        heap->mapsize = 0;
133
124
 
134
 
        return err;
 
125
        return 0;
135
126
}
136
127
 
137
128
int rt_heap_alloc(RT_HEAP *heap, size_t size, RTIME timeout, void **bufp)