summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2012-05-18 10:18:17 +0200
committerHenrik Rydberg <rydberg@euromail.se>2012-05-18 10:18:17 +0200
commitefe1dd9bf92efbf6ab74f7323c39348b5efae4ce (patch)
treedb950af6873d5da94035f1cc21d60e7179413525 /src
parent1cf398c94c1957961a7a4b8fd59f43e554016bf7 (diff)
filemap: Correct wrong signed 32/64 conversions
The 32-bit network-order conversion used a long internally. Fixed. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src')
-rw-r--r--src/hdb/filemap.cc4
-rw-r--r--src/hdb/filemap.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/hdb/filemap.cc b/src/hdb/filemap.cc
index b40644f..35cff60 100644
--- a/src/hdb/filemap.cc
+++ b/src/hdb/filemap.cc
@@ -280,9 +280,9 @@ void filemap::lock()
280{ 280{
281 if(hd) { 281 if(hd) {
282 MLOCK(mutex); 282 MLOCK(mutex);
283 if((volatile long&)hd->lock) { 283 if((volatile unsigned int&)hd->lock) {
284 time_t end=time(0)+TIMEOUT; 284 time_t end=time(0)+TIMEOUT;
285 while((volatile long&)hd->lock&&time(0)<end); 285 while((volatile unsigned int&)hd->lock&&time(0)<end);
286 } 286 }
287 hd->lock.set(1); 287 hd->lock.set(1);
288 } 288 }
diff --git a/src/hdb/filemap.h b/src/hdb/filemap.h
index d6af7eb..dd58c42 100644
--- a/src/hdb/filemap.h
+++ b/src/hdb/filemap.h
@@ -49,7 +49,7 @@ public:
49 void add(int h) { n=htonl(ntohl(n)+h); } 49 void add(int h) { n=htonl(ntohl(n)+h); }
50 int get() const { return ntohl(n); } 50 int get() const { return ntohl(n); }
51private: 51private:
52 long n; 52 unsigned int n;
53}; 53};
54 54
55////////////////////////////////////////////////////// 55//////////////////////////////////////////////////////