Skip to content

Commit

Permalink
cmd: s/write()/lxc_write_nointr()/g
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Dec 10, 2018
1 parent c14d9ff commit 41b1a84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lxc/lxc_monitord.c
Expand Up @@ -304,7 +304,7 @@ static int lxc_monitord_fifo_handler(int fd, uint32_t events, void *data,
}

for (i = 0; i < mon->clientfds_cnt; i++) {
ret = write(mon->clientfds[i], &msglxc, sizeof(msglxc));
ret = lxc_write_nointr(mon->clientfds[i], &msglxc, sizeof(msglxc));
if (ret < 0)
ERROR("Failed to send message to client file descriptor %d: %s.",
mon->clientfds[i], strerror(errno));
Expand Down Expand Up @@ -418,7 +418,7 @@ int main(int argc, char *argv[])
* if-empty-statement construct is to quiet the
* warn-unused-result warning.
*/
if (write(pipefd, "S", 1))
if (lxc_write_nointr(pipefd, "S", 1))
;
close(pipefd);

Expand Down
4 changes: 2 additions & 2 deletions src/lxc/tools/lxc_usernsexec.c
Expand Up @@ -379,7 +379,7 @@ int main(int argc, char *argv[])
return 1;
}
buf[0] = '1';
if (write(pipe_fds1[1], buf, 1) < 1) {
if (lxc_write_nointr(pipe_fds1[1], buf, 1) < 1) {
perror("write pipe");
exit(EXIT_FAILURE);
}
Expand Down Expand Up @@ -409,7 +409,7 @@ int main(int argc, char *argv[])
if (lxc_map_ids(&active_map, pid))
fprintf(stderr, "error mapping child\n");

if (write(pipe_fds2[1], buf, 1) < 0) {
if (lxc_write_nointr(pipe_fds2[1], buf, 1) < 0) {
perror("write to pipe");
exit(EXIT_FAILURE);
}
Expand Down

0 comments on commit 41b1a84

Please sign in to comment.