Commit 94928cf8 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

test/rpc: include unistd.h

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: 's avatarAndrew Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 4a895813
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
......
......@@ -6,6 +6,7 @@
#include <sys/fcntl.h>
#include <stdio.h>
#include <dirent.h>
#include <unistd.h>
#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");
......
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