From 94928cf85d8199fe90f5da5ec939a609b7c33906 Mon Sep 17 00:00:00 2001 From: Andrew Vagin Date: Mon, 10 Aug 2015 14:37:00 +0300 Subject: [PATCH] test/rpc: include unistd.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc -c test.c -I ./ test.c: In function ‘recv_resp’: test.c:18:8: warning: implicit declaration of function ‘read’ [-Wimplicit-function-declaration] len = read(socket_fd, buf, MAX_MSG_SIZE); ^ test.c: In function ‘send_req’: test.c:45:6: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration] if (write(socket_fd, buf, len) == -1) { ^ test.c: In function ‘main’: test.c:165:2: warning: implicit declaration of function ‘close’ [-Wimplicit-function-declaration] close(fd); Reported-by: Mr Jenkins Signed-off-by: Andrew Vagin Signed-off-by: Pavel Emelyanov --- test/rpc/Makefile | 4 ++-- test/rpc/test.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/rpc/Makefile b/test/rpc/Makefile index 46f36a8f3..a3a539fbc 100644 --- a/test/rpc/Makefile +++ b/test/rpc/Makefile @@ -1,6 +1,8 @@ all: test-c rpc_pb2.py criu .PHONY: all +CFLAGS += -g -Werror -Wall + run: all mkdir -p build chmod a+rwx build @@ -11,10 +13,8 @@ criu: chmod u+s $@ test-c: rpc.pb-c.o test.o - gcc $^ -o $@ -lprotobuf-c test.o: test.c - gcc -c $< -I ./ rpc_pb2.py: rpc.proto protoc --proto_path=. --python_out=. rpc.proto diff --git a/test/rpc/test.c b/test/rpc/test.c index 26e0bb6b6..9ef577848 100644 --- a/test/rpc/test.c +++ b/test/rpc/test.c @@ -6,6 +6,7 @@ #include #include #include +#include #define MAX_MSG_SIZE 1024 @@ -58,7 +59,6 @@ int main(int argc, char *argv[]) int ret = 0; struct sockaddr_un addr; socklen_t addr_len; - struct stat st = {0}; if (argc != 3) { fprintf(stderr, "Usage: test-c criu-service.socket imgs_dir");