2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 22:35:33 +00:00

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: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrew Vagin
2015-08-10 14:37:00 +03:00
committed by Pavel Emelyanov
parent 4a895813ae
commit 94928cf85d
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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");