diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-10-04 20:15:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:05:16 -0400 |
commit | 5ab1c309b344880d81494e9eab7fb27682bc6d9d (patch) | |
tree | 9509df6703c921d268db3b4b52c29992bcc24e35 /fs/coredump.c | |
parent | 0f4cfb2e4e7a7e4e97a3e90e2ba1062f07fb2cb1 (diff) |
coredump: pass siginfo_t* to do_coredump() and below, not merely signr
This is a preparatory patch for the introduction of NT_SIGINFO elf note.
With this patch we pass "siginfo_t *siginfo" instead of "int signr" to
do_coredump() and put it into coredump_params. It will be used by the
next patch. Most changes are simple s/signr/siginfo->si_signo/.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: Amerigo Wang <amwang@redhat.com>
Cc: "Jonathan M. Foote" <jmfoote@cert.org>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Pedro Alves <palves@redhat.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/coredump.c')
-rw-r--r-- | fs/coredump.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/coredump.c b/fs/coredump.c index 4fce06fc3b56..fd37facac8dc 100644 --- a/fs/coredump.c +++ b/fs/coredump.c | |||
@@ -200,7 +200,7 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm) | |||
200 | break; | 200 | break; |
201 | /* signal that caused the coredump */ | 201 | /* signal that caused the coredump */ |
202 | case 's': | 202 | case 's': |
203 | err = cn_printf(cn, "%ld", cprm->signr); | 203 | err = cn_printf(cn, "%ld", cprm->siginfo->si_signo); |
204 | break; | 204 | break; |
205 | /* UNIX time of coredump */ | 205 | /* UNIX time of coredump */ |
206 | case 't': { | 206 | case 't': { |
@@ -457,7 +457,7 @@ static int umh_pipe_setup(struct subprocess_info *info, struct cred *new) | |||
457 | return 0; | 457 | return 0; |
458 | } | 458 | } |
459 | 459 | ||
460 | void do_coredump(long signr, int exit_code, struct pt_regs *regs) | 460 | void do_coredump(siginfo_t *siginfo, struct pt_regs *regs) |
461 | { | 461 | { |
462 | struct core_state core_state; | 462 | struct core_state core_state; |
463 | struct core_name cn; | 463 | struct core_name cn; |
@@ -472,7 +472,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs) | |||
472 | bool need_nonrelative = false; | 472 | bool need_nonrelative = false; |
473 | static atomic_t core_dump_count = ATOMIC_INIT(0); | 473 | static atomic_t core_dump_count = ATOMIC_INIT(0); |
474 | struct coredump_params cprm = { | 474 | struct coredump_params cprm = { |
475 | .signr = signr, | 475 | .siginfo = siginfo, |
476 | .regs = regs, | 476 | .regs = regs, |
477 | .limit = rlimit(RLIMIT_CORE), | 477 | .limit = rlimit(RLIMIT_CORE), |
478 | /* | 478 | /* |
@@ -483,7 +483,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs) | |||
483 | .mm_flags = mm->flags, | 483 | .mm_flags = mm->flags, |
484 | }; | 484 | }; |
485 | 485 | ||
486 | audit_core_dumps(signr); | 486 | audit_core_dumps(siginfo->si_signo); |
487 | 487 | ||
488 | binfmt = mm->binfmt; | 488 | binfmt = mm->binfmt; |
489 | if (!binfmt || !binfmt->core_dump) | 489 | if (!binfmt || !binfmt->core_dump) |
@@ -507,7 +507,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs) | |||
507 | need_nonrelative = true; | 507 | need_nonrelative = true; |
508 | } | 508 | } |
509 | 509 | ||
510 | retval = coredump_wait(exit_code, &core_state); | 510 | retval = coredump_wait(siginfo->si_signo, &core_state); |
511 | if (retval < 0) | 511 | if (retval < 0) |
512 | goto fail_creds; | 512 | goto fail_creds; |
513 | 513 | ||