summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-09-14 13:48:03 +0200
committerJeremy Allison <jra@samba.org>2013-10-08 14:42:17 -0700
commitad2ba58f53a7fb6b87511288cb450f1327f1ccbf (patch)
treecab08ac8f4b00e109e10424e7edd3a08bc38a941 /source3
parentf9554a993ecb345b8773a911a6e98a7f2329422b (diff)
downloadsamba-ad2ba58f53a7fb6b87511288cb450f1327f1ccbf.tar.gz
samba-ad2ba58f53a7fb6b87511288cb450f1327f1ccbf.tar.bz2
samba-ad2ba58f53a7fb6b87511288cb450f1327f1ccbf.zip
smbd: Make add_share_mode return bool
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/locking/locking.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index d701964229..f584e0cf65 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -717,12 +717,21 @@ static void fill_share_mode_entry(struct share_mode_entry *e,
e->name_hash = fsp->name_hash;
}
-static void add_share_mode_entry(struct share_mode_data *d,
+static bool add_share_mode_entry(struct share_mode_data *d,
const struct share_mode_entry *entry)
{
- ADD_TO_ARRAY(d, struct share_mode_entry, *entry,
- &d->share_modes, &d->num_share_modes);
- d->modified = True;
+ struct share_mode_entry *tmp;
+
+ tmp = talloc_realloc(d, d->share_modes, struct share_mode_entry,
+ d->num_share_modes+1);
+ if (tmp == NULL) {
+ return false;
+ }
+ d->share_modes = tmp;
+ d->share_modes[d->num_share_modes] = *entry;
+ d->num_share_modes += 1;
+ d->modified = true;
+ return true;
}
void set_share_mode(struct share_mode_lock *lck, files_struct *fsp,