diff options
-rw-r--r-- | fs/exec.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1386,7 +1386,7 @@ EXPORT_SYMBOL(set_binfmt); | |||
1386 | * name into corename, which must have space for at least | 1386 | * name into corename, which must have space for at least |
1387 | * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator. | 1387 | * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator. |
1388 | */ | 1388 | */ |
1389 | static int format_corename(char *corename, int nr_threads, long signr) | 1389 | static int format_corename(char *corename, long signr) |
1390 | { | 1390 | { |
1391 | const char *pat_ptr = core_pattern; | 1391 | const char *pat_ptr = core_pattern; |
1392 | int ispipe = (*pat_ptr == '|'); | 1392 | int ispipe = (*pat_ptr == '|'); |
@@ -1493,8 +1493,7 @@ static int format_corename(char *corename, int nr_threads, long signr) | |||
1493 | * If core_pattern does not include a %p (as is the default) | 1493 | * If core_pattern does not include a %p (as is the default) |
1494 | * and core_uses_pid is set, then .%pid will be appended to | 1494 | * and core_uses_pid is set, then .%pid will be appended to |
1495 | * the filename. Do not do this for piped commands. */ | 1495 | * the filename. Do not do this for piped commands. */ |
1496 | if (!ispipe && !pid_in_pattern | 1496 | if (!ispipe && !pid_in_pattern && core_uses_pid) { |
1497 | && (core_uses_pid || nr_threads)) { | ||
1498 | rc = snprintf(out_ptr, out_end - out_ptr, | 1497 | rc = snprintf(out_ptr, out_end - out_ptr, |
1499 | ".%d", task_tgid_vnr(current)); | 1498 | ".%d", task_tgid_vnr(current)); |
1500 | if (rc > out_end - out_ptr) | 1499 | if (rc > out_end - out_ptr) |
@@ -1757,7 +1756,7 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) | |||
1757 | * uses lock_kernel() | 1756 | * uses lock_kernel() |
1758 | */ | 1757 | */ |
1759 | lock_kernel(); | 1758 | lock_kernel(); |
1760 | ispipe = format_corename(corename, retval, signr); | 1759 | ispipe = format_corename(corename, signr); |
1761 | unlock_kernel(); | 1760 | unlock_kernel(); |
1762 | /* | 1761 | /* |
1763 | * Don't bother to check the RLIMIT_CORE value if core_pattern points | 1762 | * Don't bother to check the RLIMIT_CORE value if core_pattern points |