Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330152
b: refs/heads/master
c: 12a2b4b
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Oct 5, 2012
1 parent a0daa89 commit 7782f62
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 179899fd5dc780fe3bcd44d0eb7823e3d855c855
refs/heads/master: 12a2b4b2241e318b4f6df31228e4272d2c2968a1
2 changes: 2 additions & 0 deletions trunk/Documentation/sysctl/kernel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ core_pattern is used to specify a core dumpfile pattern name.
%p pid
%u uid
%g gid
%d dump mode, matches PR_SET_DUMPABLE and
/proc/sys/fs/suid_dumpable
%s signal number
%t UNIX time of dump
%h hostname
Expand Down
10 changes: 7 additions & 3 deletions trunk/fs/coredump.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int cn_print_exe_file(struct core_name *cn)
* name into corename, which must have space for at least
* CORENAME_MAX_SIZE bytes plus one byte for the zero terminator.
*/
static int format_corename(struct core_name *cn, long signr)
static int format_corename(struct core_name *cn, struct coredump_params *cprm)
{
const struct cred *cred = current_cred();
const char *pat_ptr = core_pattern;
Expand Down Expand Up @@ -194,9 +194,13 @@ static int format_corename(struct core_name *cn, long signr)
case 'g':
err = cn_printf(cn, "%d", cred->gid);
break;
case 'd':
err = cn_printf(cn, "%d",
__get_dumpable(cprm->mm_flags));
break;
/* signal that caused the coredump */
case 's':
err = cn_printf(cn, "%ld", signr);
err = cn_printf(cn, "%ld", cprm->signr);
break;
/* UNIX time of coredump */
case 't': {
Expand Down Expand Up @@ -515,7 +519,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
*/
clear_thread_flag(TIF_SIGPENDING);

ispipe = format_corename(&cn, signr);
ispipe = format_corename(&cn, &cprm);

if (ispipe) {
int dump_count;
Expand Down

0 comments on commit 7782f62

Please sign in to comment.