Merge pull request #1371 from wking/respect-start-pipe-read-errors

conmon: Respect start-pipe read errors
This commit is contained in:
Daniel J Walsh 2018-03-01 04:04:45 -08:00 committed by GitHub
commit 0caee670a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1169,7 +1169,10 @@ int main(int argc, char *argv[])
/* Block for an initial write to the start pipe before
spawning any childred or exiting, to ensure the
parent can put us in the right cgroup. */
read(start_pipe_fd, buf, BUF_SIZE);
num_read = read(start_pipe_fd, buf, BUF_SIZE);
if (num_read < 0) {
pexit("start-pipe read failed");
}
close(start_pipe_fd);
}