summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-01-27 19:54:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:16 -0500
commit6a097ab20ea54a7b090ad6e62c1538d5e5997f31 (patch)
tree92032a3036b7374968b431658d53e68b47da0e69 /source3/locking
parent139acd247060841b44079f1703af0e71109ba74e (diff)
downloadsamba-6a097ab20ea54a7b090ad6e62c1538d5e5997f31.tar.gz
samba-6a097ab20ea54a7b090ad6e62c1538d5e5997f31.tar.bz2
samba-6a097ab20ea54a7b090ad6e62c1538d5e5997f31.zip
r13192: Fix up alignment issues when printing share mode
entries. Add paranioa to debug so we know when an entry is unused. Jeremy. (This used to be commit fa5fab313e3728ff49c00ca1097242039506f83e)
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/locking.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 9a13e099db..770ef918b8 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -384,11 +384,13 @@ char *share_mode_str(int num, struct share_mode_entry *e)
{
static pstring share_str;
- slprintf(share_str, sizeof(share_str)-1, "share_mode_entry[%d]: "
+ slprintf(share_str, sizeof(share_str)-1, "share_mode_entry[%d]: %s "
"pid = %s, share_access = 0x%x, private_options = 0x%x, "
"access_mask = 0x%x, mid = 0x%x, type= 0x%x, file_id = %lu, "
"dev = 0x%x, inode = %.0f",
- num, procid_str_static(&e->pid),
+ num,
+ e->op_type == UNUSED_SHARE_MODE_ENTRY ? "UNUSED" : "",
+ procid_str_static(&e->pid),
e->share_access, e->private_options,
e->access_mask, e->op_mid, e->op_type, e->share_file_id,
(unsigned int)e->dev, (double)e->inode );
@@ -408,9 +410,11 @@ static void print_share_mode_table(struct locking_data *data)
int i;
for (i = 0; i < num_share_modes; i++) {
- struct share_mode_entry *entry_p = &shares[i];
+ struct share_mode_entry entry;
+
+ memcpy(&entry, &shares[i], sizeof(struct share_mode_entry));
DEBUG(10,("print_share_mode_table: %s\n",
- share_mode_str(i, entry_p)));
+ share_mode_str(i, &entry)));
}
}