[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Sun Jul 4 06:37:35 MDT 2010
The branch, master has been updated
via 34558ae... s3: Slight reshaping of server_exists_parse
from f8e7077... s3: Don't attempt to deregister from serverid twice
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 34558ae9458519f785c1fee48982b1efccaff446
Author: Volker Lendecke <vl at samba.org>
Date: Sun Jul 4 14:35:05 2010 +0200
s3: Slight reshaping of server_exists_parse
Doing a copy and then do the compare is a bit pointless, use memcmp
-----------------------------------------------------------------------
Summary of changes:
source3/lib/serverid.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
index 5f97bd3..e9c7296 100644
--- a/source3/lib/serverid.c
+++ b/source3/lib/serverid.c
@@ -183,10 +183,12 @@ static int server_exists_parse(TDB_DATA key, TDB_DATA data, void *priv)
return -1;
}
- /* memcpy, data.dptr might not be aligned */
- memcpy(&unique_id, data.dptr, sizeof(unique_id));
-
- state->exists = (state->id->unique_id == unique_id);
+ /*
+ * Use memcmp, not direct compare. data.dptr might not be
+ * aligned.
+ */
+ state->exists =
+ (memcmp(&unique_id, data.dptr, sizeof(unique_id)) == 0);
return 0;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list