1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00

util: use GNU comparison function prototype for qsort_safe()

This commit is contained in:
Lennart Poettering 2015-05-14 11:30:14 +02:00
parent 7185d80558
commit aeb24f3081

View File

@ -779,13 +779,13 @@ int shall_restore_state(void);
* Normal qsort requires base to be nonnull. Here were require
* that only if nmemb > 0.
*/
static inline void qsort_safe(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *)) {
if (nmemb) {
static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) {
if (nmemb <= 0)
return;
assert(base);
qsort(base, nmemb, size, compar);
}
}
int proc_cmdline(char **ret);
int parse_proc_cmdline(int (*parse_word)(const char *key, const char *value));