From: Lennart Poettering Date: Fri, 25 Oct 2019 14:05:35 +0000 (+0200) Subject: analyze: sort list of unknown syscalls kernel implements X-Git-Tag: v244-rc1~131 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea334dc328c9bbba68098d2f779293528a123c23;p=thirdparty%2Fsystemd.git analyze: sort list of unknown syscalls kernel implements --- diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 4d81026084e..1871a4363ef 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -1757,15 +1757,21 @@ static int dump_syscall_filters(int argc, char *argv[], void *userdata) { fflush(stdout); log_notice_errno(k, "# Not showing unlisted system calls, couldn't retrieve kernel system call list: %m"); } else if (!set_isempty(kernel)) { - const char *syscall; - Iterator j; + _cleanup_free_ char **l = NULL; + char **syscall; printf("\n" "# %sUnlisted System Calls%s (supported by the local kernel, but not included in any of the groups listed above):\n", ansi_highlight(), ansi_normal()); - SET_FOREACH(syscall, kernel, j) - printf("# %s\n", syscall); + l = set_get_strv(kernel); + if (!l) + return log_oom(); + + strv_sort(l); + + STRV_FOREACH(syscall, l) + printf("# %s\n", *syscall); } } else { char **name;