- descriptor if not working with anonymous memory. */
- if ( !(mdp->flags & MMALLOC_ANONYMOUS) && mdp -> fd < 0)
- {
- result = NULL;
- }
- else if ((char*)mdp -> breakval + size > (char*)mdp -> top)
- {
- /* The request would move us past the end of the currently
- mapped memory, so map in enough more memory to satisfy
- the request. This means we also have to grow the mapped-to
- file by an appropriate amount, since mmap cannot be used
- to extend a file. */
- moveto = PAGE_ALIGN ((char*)mdp -> breakval + size);
- mapbytes = (char*)moveto - (char*)mdp -> top;
- foffset = (char*)mdp -> top - (char*)mdp -> base;
-
- if( mdp -> fd > 0){
- /* FIXME: Test results of lseek() and write() */
- lseek (mdp -> fd, foffset + mapbytes - 1, SEEK_SET);
- write (mdp -> fd, &buf, 1);
+ descriptor if not working with anonymous memory. */
+ if (!(mdp->flags & MMALLOC_ANONYMOUS) && mdp->fd < 0) {
+ result = NULL;
+ } else if ((char *) mdp->breakval + size > (char *) mdp->top) {
+ /* The request would move us past the end of the currently
+ mapped memory, so map in enough more memory to satisfy
+ the request. This means we also have to grow the mapped-to
+ file by an appropriate amount, since mmap cannot be used
+ to extend a file. */
+ moveto = PAGE_ALIGN((char *) mdp->breakval + size);
+ mapbytes = (char *) moveto - (char *) mdp->top;
+ foffset = (char *) mdp->top - (char *) mdp->base;
+
+ if (mdp->fd > 0) {
+ /* FIXME: Test results of lseek() and write() */
+ lseek(mdp->fd, foffset + mapbytes - 1, SEEK_SET);
+ test = write(mdp->fd, &buf, 1);