diff options
Diffstat (limited to 'arch/um/drivers/chan_user.c')
-rw-r--r-- | arch/um/drivers/chan_user.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c index 77557e233f58..d29e56d8ced4 100644 --- a/arch/um/drivers/chan_user.c +++ b/arch/um/drivers/chan_user.c | |||
@@ -38,7 +38,16 @@ int generic_read(int fd, char *c_out, void *unused) | |||
38 | 38 | ||
39 | int generic_write(int fd, const char *buf, int n, void *unused) | 39 | int generic_write(int fd, const char *buf, int n, void *unused) |
40 | { | 40 | { |
41 | return write(fd, buf, n); | 41 | int err; |
42 | |||
43 | err = write(fd, buf, n); | ||
44 | if (err > 0) | ||
45 | return err; | ||
46 | else if (errno == EAGAIN) | ||
47 | return 0; | ||
48 | else if (err == 0) | ||
49 | return -EIO; | ||
50 | return -errno; | ||
42 | } | 51 | } |
43 | 52 | ||
44 | int generic_window_size(int fd, void *unused, unsigned short *rows_out, | 53 | int generic_window_size(int fd, void *unused, unsigned short *rows_out, |