aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/chan_kern.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/drivers/chan_kern.c')
-rw-r--r--arch/um/drivers/chan_kern.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c
index 368d3e97dfd9..629b00e3b0b0 100644
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@ -157,7 +157,7 @@ static void tty_receive_char(struct tty_struct *tty, char ch)
157 157
158static int open_one_chan(struct chan *chan) 158static int open_one_chan(struct chan *chan)
159{ 159{
160 int fd; 160 int fd, err;
161 161
162 if(chan->opened) 162 if(chan->opened)
163 return 0; 163 return 0;
@@ -168,6 +168,13 @@ static int open_one_chan(struct chan *chan)
168 chan->data, &chan->dev); 168 chan->data, &chan->dev);
169 if(fd < 0) 169 if(fd < 0)
170 return fd; 170 return fd;
171
172 err = os_set_fd_block(fd, 0);
173 if (err) {
174 (*chan->ops->close)(fd, chan->data);
175 return err;
176 }
177
171 chan->fd = fd; 178 chan->fd = fd;
172 179
173 chan->opened = 1; 180 chan->opened = 1;