summaryrefslogtreecommitdiff
path: root/src/journal/journald-rate-limit.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-10-06 18:12:25 +0200
committerDaniel Mack <github@zonque.org>2015-10-06 18:12:25 +0200
commitac773fd8d56cafe29e9fedecb02655d86bd3fe30 (patch)
tree975b63290cb0075a64e319a572a5086ba0ada268 /src/journal/journald-rate-limit.c
parent8c60d978bd3453659bfa7f4d90a17ba5fa3e0774 (diff)
parent17010c230edf9933176948934276cf18007ccadb (diff)
Merge pull request #1474 from teg/siphash24
siphash: style fixes
Diffstat (limited to 'src/journal/journald-rate-limit.c')
-rw-r--r--src/journal/journald-rate-limit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/journal/journald-rate-limit.c b/src/journal/journald-rate-limit.c
index 7e06117b31..8afd493b50 100644
--- a/src/journal/journald-rate-limit.c
+++ b/src/journal/journald-rate-limit.c
@@ -57,7 +57,7 @@ struct JournalRateLimitGroup {
char *id;
JournalRateLimitPool pools[POOLS_MAX];
- unsigned long hash;
+ uint64_t hash;
LIST_FIELDS(JournalRateLimitGroup, bucket);
LIST_FIELDS(JournalRateLimitGroup, lru);
@@ -158,9 +158,9 @@ static JournalRateLimitGroup* journal_rate_limit_group_new(JournalRateLimit *r,
if (!g->id)
goto fail;
- siphash_init(&state, r->hash_key);
+ siphash24_init(&state, r->hash_key);
string_hash_func(g->id, &state);
- g->hash = siphash24_finalize(&state);
+ siphash24_finalize((uint8_t*)&g->hash, &state);
journal_rate_limit_vacuum(r, ts);
@@ -207,7 +207,7 @@ static unsigned burst_modulate(unsigned burst, uint64_t available) {
}
int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priority, uint64_t available) {
- unsigned long h;
+ uint64_t h;
JournalRateLimitGroup *g;
JournalRateLimitPool *p;
struct siphash state;
@@ -226,9 +226,9 @@ int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priority, u
ts = now(CLOCK_MONOTONIC);
- siphash_init(&state, r->hash_key);
+ siphash24_init(&state, r->hash_key);
string_hash_func(id, &state);
- h = siphash24_finalize(&state);
+ siphash24_finalize((uint8_t*)&h, &state);
g = r->buckets[h % BUCKETS_MAX];
LIST_FOREACH(bucket, g, g)