]> Pileus Git - ~andy/linux/blobdiff - fs/coredump.c
file->f_op is never NULL...
[~andy/linux] / fs / coredump.c
index 72f816d6cad99d4d1f81433e928d42e540295188..42c3b842366980bcdb12dae8eace880464c50cd4 100644 (file)
@@ -190,6 +190,11 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm)
                                err = cn_printf(cn, "%d",
                                              task_tgid_vnr(current));
                                break;
+                       /* global pid */
+                       case 'P':
+                               err = cn_printf(cn, "%d",
+                                             task_tgid_nr(current));
+                               break;
                        /* uid */
                        case 'u':
                                err = cn_printf(cn, "%d", cred->uid);
@@ -640,7 +645,7 @@ void do_coredump(siginfo_t *siginfo)
                 */
                if (!uid_eq(inode->i_uid, current_fsuid()))
                        goto close_fail;
-               if (!cprm.file->f_op || !cprm.file->f_op->write)
+               if (!cprm.file->f_op->write)
                        goto close_fail;
                if (do_truncate(cprm.file->f_path.dentry, 0, 0, cprm.file))
                        goto close_fail;