core: allow to specify errno number in SystemCallErrorNumber=

This commit is contained in:
Yu Watanabe
2017-11-11 21:54:24 +09:00
parent b4891260b9
commit 3df90f24cc
5 changed files with 22 additions and 21 deletions
+11 -4
View File
@@ -4129,10 +4129,17 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
prefix, s);
}
if (c->syscall_errno > 0)
fprintf(f,
"%sSystemCallErrorNumber: %s\n",
prefix, strna(errno_to_name(c->syscall_errno)));
if (c->syscall_errno > 0) {
const char *errno_name;
fprintf(f, "%sSystemCallErrorNumber: ", prefix);
errno_name = errno_to_name(c->syscall_errno);
if (errno_name)
fprintf(f, "%s\n", errno_name);
else
fprintf(f, "%d\n", c->syscall_errno);
}
if (c->apparmor_profile)
fprintf(f,