1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-31 16:21:26 +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,12 +779,12 @@ 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) {
assert(base);
qsort(base, nmemb, size, compar);
}
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);