caps: handle EINTR in read()

We don't want to link caps.{c,h} against utils.{c,h} for the sake of our static builds init.lxc.static. This means lxc_write_nointr() will not be available. So handle it EINTR. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent c66853b8
......@@ -315,7 +315,11 @@ static int _real_caps_last_cap(void)
char *ptr;
int n;
if ((n = read(fd, buf, 31)) >= 0) {
again:
n = read(fd, buf, 31);
if (n < 0 && errno == EINTR) {
goto again;
} else if (n >= 0) {
buf[n] = '\0';
errno = 0;
......
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