cmd: s/read()/lxc_read_nointr()/g

parent 41b1a847
...@@ -158,7 +158,7 @@ static int lxc_monitord_sock_handler(int fd, uint32_t events, void *data, ...@@ -158,7 +158,7 @@ static int lxc_monitord_sock_handler(int fd, uint32_t events, void *data,
int rc; int rc;
char buf[4]; char buf[4];
rc = read(fd, buf, sizeof(buf)); rc = lxc_read_nointr(fd, buf, sizeof(buf));
if (rc > 0 && !strncmp(buf, "quit", 4)) if (rc > 0 && !strncmp(buf, "quit", 4))
quit = 1; quit = 1;
} }
...@@ -297,7 +297,7 @@ static int lxc_monitord_fifo_handler(int fd, uint32_t events, void *data, ...@@ -297,7 +297,7 @@ static int lxc_monitord_fifo_handler(int fd, uint32_t events, void *data,
struct lxc_msg msglxc; struct lxc_msg msglxc;
struct lxc_monitor *mon = data; struct lxc_monitor *mon = data;
ret = read(fd, &msglxc, sizeof(msglxc)); ret = lxc_read_nointr(fd, &msglxc, sizeof(msglxc));
if (ret != sizeof(msglxc)) { if (ret != sizeof(msglxc)) {
SYSERROR("Reading from fifo failed: %s.", strerror(errno)); SYSERROR("Reading from fifo failed: %s.", strerror(errno));
return 1; return 1;
......
...@@ -383,7 +383,7 @@ int main(int argc, char *argv[]) ...@@ -383,7 +383,7 @@ int main(int argc, char *argv[])
perror("write pipe"); perror("write pipe");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (read(pipe_fds2[0], buf, 1) < 1) { if (lxc_read_nointr(pipe_fds2[0], buf, 1) < 1) {
perror("read pipe"); perror("read pipe");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -399,7 +399,7 @@ int main(int argc, char *argv[]) ...@@ -399,7 +399,7 @@ int main(int argc, char *argv[])
close(pipe_fds1[1]); close(pipe_fds1[1]);
close(pipe_fds2[0]); close(pipe_fds2[0]);
if (read(pipe_fds1[0], buf, 1) < 1) { if (lxc_read_nointr(pipe_fds1[0], buf, 1) < 1) {
perror("read pipe"); perror("read pipe");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment