Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105426
b: refs/heads/master
c: be61a86
h: refs/heads/master
v: v3
  • Loading branch information
Ulrich Drepper authored and Linus Torvalds committed Jul 24, 2008
1 parent f6c6cdb commit 9fc0327
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 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: 6b1ef0e60d42f2fdaec26baee8327eb156347b4f
refs/heads/master: be61a86d7237dd80510615f38ae21d6e1e98660c
14 changes: 7 additions & 7 deletions trunk/fs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ static struct inode * get_pipe_inode(void)
return NULL;
}

struct file *create_write_pipe(void)
struct file *create_write_pipe(int flags)
{
int err;
struct inode *inode;
Expand Down Expand Up @@ -983,7 +983,7 @@ struct file *create_write_pipe(void)
goto err_dentry;
f->f_mapping = inode->i_mapping;

f->f_flags = O_WRONLY;
f->f_flags = O_WRONLY | (flags & O_NONBLOCK);
f->f_version = 0;

return f;
Expand All @@ -1007,7 +1007,7 @@ void free_write_pipe(struct file *f)
put_filp(f);
}

struct file *create_read_pipe(struct file *wrf)
struct file *create_read_pipe(struct file *wrf, int flags)
{
struct file *f = get_empty_filp();
if (!f)
Expand All @@ -1019,7 +1019,7 @@ struct file *create_read_pipe(struct file *wrf)
f->f_mapping = wrf->f_path.dentry->d_inode->i_mapping;

f->f_pos = 0;
f->f_flags = O_RDONLY;
f->f_flags = O_RDONLY | (flags & O_NONBLOCK);
f->f_op = &read_pipe_fops;
f->f_mode = FMODE_READ;
f->f_version = 0;
Expand All @@ -1033,13 +1033,13 @@ int do_pipe_flags(int *fd, int flags)
int error;
int fdw, fdr;

if (flags & ~O_CLOEXEC)
if (flags & ~(O_CLOEXEC | O_NONBLOCK))
return -EINVAL;

fw = create_write_pipe();
fw = create_write_pipe(flags);
if (IS_ERR(fw))
return PTR_ERR(fw);
fr = create_read_pipe(fw);
fr = create_read_pipe(fw, flags);
error = PTR_ERR(fr);
if (IS_ERR(fr))
goto err_write_pipe;
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1778,8 +1778,8 @@ static inline void allow_write_access(struct file *file)
}
extern int do_pipe(int *);
extern int do_pipe_flags(int *, int);
extern struct file *create_read_pipe(struct file *f);
extern struct file *create_write_pipe(void);
extern struct file *create_read_pipe(struct file *f, int flags);
extern struct file *create_write_pipe(int flags);
extern void free_write_pipe(struct file *);

extern struct file *do_filp_open(int dfd, const char *pathname,
Expand Down
4 changes: 2 additions & 2 deletions trunk/kernel/kmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,12 @@ int call_usermodehelper_stdinpipe(struct subprocess_info *sub_info,
{
struct file *f;

f = create_write_pipe();
f = create_write_pipe(0);
if (IS_ERR(f))
return PTR_ERR(f);
*filp = f;

f = create_read_pipe(f);
f = create_read_pipe(f, 0);
if (IS_ERR(f)) {
free_write_pipe(*filp);
return PTR_ERR(f);
Expand Down

0 comments on commit 9fc0327

Please sign in to comment.