C version of #1006
Note that I switched all the C builds to use -O2 and that meant
that the compiler found some more warnings so I also fixed these
up. The possibly undefined ones were harmless, the aliasing one
is now more correct.
As these are small programs, the caching from `docker build` makes
no real difference, and worst case compile time is much better.
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Also tidy up some of the coding style to be more Linux kernel style
which most of the code already was.
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
-r == read from the vsock
-w == write to the vsock
This makes it easier to write automated test cases.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
Rather than exiting when the first read hits EOF, ignoring any remaining data
going the other way.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>