summaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-07-21 15:33:25 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-29 21:24:19 +0400
commite4fad8e5d220e3dfb1050eee752ee5058f29a232 (patch)
treeb56356fda1d1f4f47e1da63aa24080db999dafc1 /fs/exec.c
parentb5bcdda32736b94a7d178d156d80a69f536ad468 (diff)
downloadlinux-e4fad8e5d220e3dfb1050eee752ee5058f29a232.tar.gz
linux-e4fad8e5d220e3dfb1050eee752ee5058f29a232.tar.bz2
linux-e4fad8e5d220e3dfb1050eee752ee5058f29a232.zip
consolidate pipe file creation
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/fs/exec.c b/fs/exec.c
index da27b91ff1e8..b800fb87f6ce 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -2069,25 +2069,18 @@ static void wait_for_dump_helpers(struct file *file)
*/
static int umh_pipe_setup(struct subprocess_info *info, struct cred *new)
{
- struct file *rp, *wp;
+ struct file *files[2];
struct fdtable *fdt;
struct coredump_params *cp = (struct coredump_params *)info->data;
struct files_struct *cf = current->files;
+ int err = create_pipe_files(files, 0);
+ if (err)
+ return err;
- wp = create_write_pipe(0);
- if (IS_ERR(wp))
- return PTR_ERR(wp);
-
- rp = create_read_pipe(wp, 0);
- if (IS_ERR(rp)) {
- free_write_pipe(wp);
- return PTR_ERR(rp);
- }
-
- cp->file = wp;
+ cp->file = files[1];
sys_close(0);
- fd_install(0, rp);
+ fd_install(0, files[0]);
spin_lock(&cf->file_lock);
fdt = files_fdtable(cf);
__set_open_fd(0, fdt);