[gvfs] Fix a symbol conflict with crc32
- From: Matthias Clasen <matthiasc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gvfs] Fix a symbol conflict with crc32
- Date: Fri, 31 Jul 2009 21:57:57 +0000 (UTC)
commit 20fdd8d01515c8b40aa24de196e69d4990953844
Author: Joe Marcus Clarke <marcus freebsd org>
Date: Fri Jul 31 17:56:05 2009 -0400
Fix a symbol conflict with crc32
On FreeBSD, the crc32 symbol conflicts with a function of the same
name in libz, causing segfaults. Fixes bug 589786.
metadata/crc32.c | 2 +-
metadata/crc32.h | 2 +-
metadata/metatree.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/metadata/crc32.c b/metadata/crc32.c
index 5eb64df..5441f8c 100644
--- a/metadata/crc32.c
+++ b/metadata/crc32.c
@@ -82,7 +82,7 @@ static const guint32 crcTable[256] = {
};
guint32
-crc32 (const void *ptr, size_t len)
+metadata_crc32 (const void *ptr, size_t len)
{
guint32 crc = 0xFFFFFFFF;
const guint8 *bp = (const guint8 *) ptr;
diff --git a/metadata/crc32.h b/metadata/crc32.h
index 2a820bd..b8a62b1 100644
--- a/metadata/crc32.h
+++ b/metadata/crc32.h
@@ -46,4 +46,4 @@
#include <glib.h>
-guint32 crc32(const void *ptr, size_t len);
+guint32 metadata_crc32(const void *ptr, size_t len);
diff --git a/metadata/metatree.c b/metadata/metatree.c
index 0f66893..18bdc43 100644
--- a/metadata/metatree.c
+++ b/metadata/metatree.c
@@ -896,7 +896,7 @@ verify_journal_entry (MetaJournal *journal,
if (entry_len != entry_len_end)
return NULL;
- real_crc32 = crc32 (journal->data + offset + 8, entry_len - 8);
+ real_crc32 = metadata_crc32 (journal->data + offset + 8, entry_len - 8);
if (real_crc32 != GUINT32_FROM_BE (entry->crc32))
return NULL;
@@ -1019,7 +1019,7 @@ meta_journal_entry_finish (GString *out)
len = out->len + 4;
append_uint32 (out, len);
set_uint32 (out, 0, len);
- set_uint32 (out, 4, crc32 (out->str + 8, len - 8));
+ set_uint32 (out, 4, metadata_crc32 (out->str + 8, len - 8));
return out;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]