it's a bit confusing that on 32bit systems we'd risk session IDs
overruns like this. Let's expose the same behaviour everywhere and stick
to 64bit ids.
Since we format the ids as strings anyway this doesn't really change
anything performance-wise, it just pushes out collisions by overrun to
basically never happen.
do {
id = mfree(id);
- if (asprintf(&id, "c%lu", ++m->session_counter) < 0)
+ if (asprintf(&id, "c%" PRIu64, ++m->session_counter) < 0)
return -ENOMEM;
} while (hashmap_contains(m->sessions, id));
do {
id = mfree(id);
- if (asprintf(&id, "%lu", ++m->inhibit_counter) < 0)
+ if (asprintf(&id, "%" PRIu64, ++m->inhibit_counter) < 0)
return -ENOMEM;
} while (hashmap_get(m->inhibitors, id));
char **kill_only_users, **kill_exclude_users;
bool kill_user_processes;
- unsigned long session_counter;
- unsigned long inhibit_counter;
+ uint64_t session_counter;
+ uint64_t inhibit_counter;
Hashmap *session_units;
Hashmap *user_units;