Merge pull request #1005 from tych0/warn-about-unexpected-sync-size

sync: fail on unexpected message sizes
This commit is contained in:
Serge Hallyn 2016-05-06 18:16:21 -05:00
commit bced9b015a

View File

@ -47,6 +47,11 @@ static int __sync_wait(int fd, int sequence)
if (!ret)
return 0;
if (ret != sizeof(sync)) {
ERROR("unexpected sync size: %d expected %lu", ret, sizeof(sync));
return -1;
}
if (sync == LXC_SYNC_ERROR) {
ERROR("An error occurred in another process "
"(expected sequence number %d)", sequence);