tests: others,rpc -- Tune up header

Submitted by Cyrill Gorcunov on June 21, 2018, 8:32 a.m.

Details

Message ID 20180621083253.14775-1-gorcunov@gmail.com
State Accepted
Series "tests: others,rpc -- Tune up header"
Commit 7ac24b534810d416df0f118811b76e541fec6aa9
Headers show

Commit Message

Cyrill Gorcunov June 21, 2018, 8:32 a.m.
- string.h is missed for memX helpers
 - fcntl.h should be included instead of sys

With this patch the test-c is compiled on alpine tests,
but there is a problem related to the container itself

 | protoc-c --proto_path=. --c_out=. rpc.proto
 | gcc -g -Werror -Wall -I.   -c -o test-c.o test-c.c
 | gcc -g -Werror -Wall -I.   -c -o rpc.pb-c.o rpc.pb-c.c
 | gcc   test-c.o rpc.pb-c.o  -lprotobuf-c -o test-c
 | protoc --proto_path=. --python_out=. rpc.proto
 | cp ../../../criu/criu criu
 | chmod u+s criu
 | mkdir -p build
 | chmod a+rwx build
 | sudo -g '#1000' -u '#1000' ./criu service -v4 -W build -o service.log --address criu_service.socket -d --pidfile pidfile
 | make: sudo: Command not found

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 test/others/rpc/test-c.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/test/others/rpc/test-c.c b/test/others/rpc/test-c.c
index 490a07a4f4b9..f210a973a5c3 100644
--- a/test/others/rpc/test-c.c
+++ b/test/others/rpc/test-c.c
@@ -3,7 +3,8 @@ 
 #include <stdbool.h>
 #include <sys/socket.h>
 #include <sys/un.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
+#include <string.h>
 #include <stdio.h>
 #include <dirent.h>
 #include <unistd.h>

Comments

Andrey Vagin June 21, 2018, 9:16 p.m.
Applied, thanks!
On Thu, Jun 21, 2018 at 11:32:53AM +0300, Cyrill Gorcunov wrote:
>  - string.h is missed for memX helpers
>  - fcntl.h should be included instead of sys
> 
> With this patch the test-c is compiled on alpine tests,
> but there is a problem related to the container itself
> 
>  | protoc-c --proto_path=. --c_out=. rpc.proto
>  | gcc -g -Werror -Wall -I.   -c -o test-c.o test-c.c
>  | gcc -g -Werror -Wall -I.   -c -o rpc.pb-c.o rpc.pb-c.c
>  | gcc   test-c.o rpc.pb-c.o  -lprotobuf-c -o test-c
>  | protoc --proto_path=. --python_out=. rpc.proto
>  | cp ../../../criu/criu criu
>  | chmod u+s criu
>  | mkdir -p build
>  | chmod a+rwx build
>  | sudo -g '#1000' -u '#1000' ./criu service -v4 -W build -o service.log --address criu_service.socket -d --pidfile pidfile
>  | make: sudo: Command not found
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> ---
>  test/others/rpc/test-c.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/test/others/rpc/test-c.c b/test/others/rpc/test-c.c
> index 490a07a4f4b9..f210a973a5c3 100644
> --- a/test/others/rpc/test-c.c
> +++ b/test/others/rpc/test-c.c
> @@ -3,7 +3,8 @@
>  #include <stdbool.h>
>  #include <sys/socket.h>
>  #include <sys/un.h>
> -#include <sys/fcntl.h>
> +#include <fcntl.h>
> +#include <string.h>
>  #include <stdio.h>
>  #include <dirent.h>
>  #include <unistd.h>
> -- 
> 2.14.4
>