Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105945
b: refs/heads/master
c: 565b9b1
h: refs/heads/master
i:
  105943: f7deec4
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Jul 25, 2008
1 parent 2111cf8 commit de03745
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 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: a94e2d408eaedbd85aae259621d46fafc10479a2
refs/heads/master: 565b9b14e7f48131bca58840aa404bbef058fa89
13 changes: 5 additions & 8 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1379,17 +1379,14 @@ EXPORT_SYMBOL(set_binfmt);
* 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(char *corename, const char *pattern, long signr)
static int format_corename(char *corename, int nr_threads, long signr)
{
const char *pat_ptr = pattern;
const char *pat_ptr = core_pattern;
int ispipe = (*pat_ptr == '|');
char *out_ptr = corename;
char *const out_end = corename + CORENAME_MAX_SIZE;
int rc;
int pid_in_pattern = 0;
int ispipe = 0;

if (*pattern == '|')
ispipe = 1;

/* Repeat as long as we have more pattern to process and more output
space */
Expand Down Expand Up @@ -1490,7 +1487,7 @@ static int format_corename(char *corename, const char *pattern, long signr)
* and core_uses_pid is set, then .%pid will be appended to
* the filename. Do not do this for piped commands. */
if (!ispipe && !pid_in_pattern
&& (core_uses_pid || atomic_read(&current->mm->mm_users) != 1)) {
&& (core_uses_pid || nr_threads)) {
rc = snprintf(out_ptr, out_end - out_ptr,
".%d", task_tgid_vnr(current));
if (rc > out_end - out_ptr)
Expand Down Expand Up @@ -1753,7 +1750,7 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs)
* uses lock_kernel()
*/
lock_kernel();
ispipe = format_corename(corename, core_pattern, signr);
ispipe = format_corename(corename, retval, signr);
unlock_kernel();
/*
* Don't bother to check the RLIMIT_CORE value if core_pattern points
Expand Down

0 comments on commit de03745

Please sign in to comment.