diff options
Diffstat (limited to 'arch/um/os-Linux/sigio.c')
-rw-r--r-- | arch/um/os-Linux/sigio.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c index 8ccf6a36f1c6..8d4e0c6b8c92 100644 --- a/arch/um/os-Linux/sigio.c +++ b/arch/um/os-Linux/sigio.c | |||
@@ -69,11 +69,12 @@ static int write_sigio_thread(void *unused) | |||
69 | p = &fds->poll[i]; | 69 | p = &fds->poll[i]; |
70 | if(p->revents == 0) continue; | 70 | if(p->revents == 0) continue; |
71 | if(p->fd == sigio_private[1]){ | 71 | if(p->fd == sigio_private[1]){ |
72 | n = os_read_file(sigio_private[1], &c, sizeof(c)); | 72 | CATCH_EINTR(n = read(sigio_private[1], &c, |
73 | sizeof(c))); | ||
73 | if(n != sizeof(c)) | 74 | if(n != sizeof(c)) |
74 | printk("write_sigio_thread : " | 75 | printk("write_sigio_thread : " |
75 | "read on socket failed, " | 76 | "read on socket failed, " |
76 | "err = %d\n", -n); | 77 | "err = %d\n", errno); |
77 | tmp = current_poll; | 78 | tmp = current_poll; |
78 | current_poll = next_poll; | 79 | current_poll = next_poll; |
79 | next_poll = tmp; | 80 | next_poll = tmp; |
@@ -86,10 +87,10 @@ static int write_sigio_thread(void *unused) | |||
86 | (fds->used - i) * sizeof(*fds->poll)); | 87 | (fds->used - i) * sizeof(*fds->poll)); |
87 | } | 88 | } |
88 | 89 | ||
89 | n = os_write_file(respond_fd, &c, sizeof(c)); | 90 | CATCH_EINTR(n = write(respond_fd, &c, sizeof(c))); |
90 | if(n != sizeof(c)) | 91 | if(n != sizeof(c)) |
91 | printk("write_sigio_thread : write on socket " | 92 | printk("write_sigio_thread : write on socket " |
92 | "failed, err = %d\n", -n); | 93 | "failed, err = %d\n", errno); |
93 | } | 94 | } |
94 | } | 95 | } |
95 | 96 | ||
@@ -127,15 +128,15 @@ static void update_thread(void) | |||
127 | char c; | 128 | char c; |
128 | 129 | ||
129 | flags = set_signals(0); | 130 | flags = set_signals(0); |
130 | n = os_write_file(sigio_private[0], &c, sizeof(c)); | 131 | n = write(sigio_private[0], &c, sizeof(c)); |
131 | if(n != sizeof(c)){ | 132 | if(n != sizeof(c)){ |
132 | printk("update_thread : write failed, err = %d\n", -n); | 133 | printk("update_thread : write failed, err = %d\n", errno); |
133 | goto fail; | 134 | goto fail; |
134 | } | 135 | } |
135 | 136 | ||
136 | n = os_read_file(sigio_private[0], &c, sizeof(c)); | 137 | CATCH_EINTR(n = read(sigio_private[0], &c, sizeof(c))); |
137 | if(n != sizeof(c)){ | 138 | if(n != sizeof(c)){ |
138 | printk("update_thread : read failed, err = %d\n", -n); | 139 | printk("update_thread : read failed, err = %d\n", errno); |
139 | goto fail; | 140 | goto fail; |
140 | } | 141 | } |
141 | 142 | ||
@@ -459,10 +460,10 @@ static void tty_output(int master, int slave) | |||
459 | 460 | ||
460 | memset(buf, 0, sizeof(buf)); | 461 | memset(buf, 0, sizeof(buf)); |
461 | 462 | ||
462 | while(os_write_file(master, buf, sizeof(buf)) > 0) ; | 463 | while(write(master, buf, sizeof(buf)) > 0) ; |
463 | if(errno != EAGAIN) | 464 | if(errno != EAGAIN) |
464 | panic("tty_output : write failed, errno = %d\n", errno); | 465 | panic("tty_output : write failed, errno = %d\n", errno); |
465 | while(((n = os_read_file(slave, buf, sizeof(buf))) > 0) && !got_sigio) ; | 466 | while(((n = read(slave, buf, sizeof(buf))) > 0) && !got_sigio) ; |
466 | 467 | ||
467 | if(got_sigio){ | 468 | if(got_sigio){ |
468 | printk("Yes\n"); | 469 | printk("Yes\n"); |