diff options
author | Richard Sharpe <sharpe@samba.org> | 2003-04-22 06:35:44 +0000 |
---|---|---|
committer | Richard Sharpe <sharpe@samba.org> | 2003-04-22 06:35:44 +0000 |
commit | 186824a96777e9998fbb82c58e8e0ad848a9353a (patch) | |
tree | ff6257ac1420991b685205df2137478e6285fc9b /source3 | |
parent | 6e6497318fd4b21ee7a13c74abedd0e51f7ab638 (diff) | |
download | samba-186824a96777e9998fbb82c58e8e0ad848a9353a.tar.gz samba-186824a96777e9998fbb82c58e8e0ad848a9353a.tar.bz2 samba-186824a96777e9998fbb82c58e8e0ad848a9353a.zip |
Complete the space allocation code for HBIN blocks ...
(This used to be commit ae5f8e4b5f7b8880293cc94c9bbe0df81a56959e)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/editreg.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/source3/utils/editreg.c b/source3/utils/editreg.c index 0229395176..bdfb3dc832 100644 --- a/source3/utils/editreg.c +++ b/source3/utils/editreg.c @@ -2522,15 +2522,39 @@ void *nt_alloc_regf_space(REGF *regf, int size, int *off) /* * Fix up the free space ptr + * If it is NULL, we fix it up next time */ - } + if (!blk->free_space) + regf->free_space = blk->next; + + *off = tmp; + return ret; + } } /* * If we got here, we need to add another block, which might be * larger than one block -- deal with that later */ + if (nt_create_hbin_blk(regf, REGF_HDR_BLKSIZ)) { + blk = regf->free_space; + tmp = blk->file_offset + blk->fsp_off; + ret = blk->data + blk->fsp_off; + blk->free_space -= size; + blk->fsp_off += size; + + /* + * Fix up the free space ptr + * If it is NULL, we fix it up next time + */ + + if (!blk->free_space) + regf->free_space = blk->next; + + *off = tmp; + return ret; + } return NULL; } |