Commit a1e74073 authored by Ruslan Kuprieiev's avatar Ruslan Kuprieiev Committed by Pavel Emelyanov

service: move constants to cr-service-const.h

Such constants as CR_MAX_MSG_SIZE and CR_DEFAULT_SERVICE_ADDRESS are need to be used in both service and lib.
Signed-off-by: 's avatarRuslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent ba18a5e1
...@@ -19,16 +19,17 @@ ...@@ -19,16 +19,17 @@
#include "log.h" #include "log.h"
#include "pstree.h" #include "pstree.h"
#include "cr-service.h" #include "cr-service.h"
#include "cr-service-const.h"
#include "sd-daemon.h" #include "sd-daemon.h"
unsigned int service_sk_ino = -1; unsigned int service_sk_ino = -1;
static int recv_criu_msg(int socket_fd, CriuReq **msg) static int recv_criu_msg(int socket_fd, CriuReq **msg)
{ {
unsigned char buf[MAX_MSG_SIZE]; unsigned char buf[CR_MAX_MSG_SIZE];
int len; int len;
len = read(socket_fd, buf, MAX_MSG_SIZE); len = read(socket_fd, buf, CR_MAX_MSG_SIZE);
if (len == -1) { if (len == -1) {
pr_perror("Can't read request"); pr_perror("Can't read request");
return -1; return -1;
...@@ -45,7 +46,7 @@ static int recv_criu_msg(int socket_fd, CriuReq **msg) ...@@ -45,7 +46,7 @@ static int recv_criu_msg(int socket_fd, CriuReq **msg)
static int send_criu_msg(int socket_fd, CriuResp *msg) static int send_criu_msg(int socket_fd, CriuResp *msg)
{ {
unsigned char buf[MAX_MSG_SIZE]; unsigned char buf[CR_MAX_MSG_SIZE];
int len; int len;
len = criu_resp__get_packed_size(msg); len = criu_resp__get_packed_size(msg);
......
#ifndef __CR_SERVICE_CONST_H__
#define __CR_SERVICE_CONST_H__
#define CR_MAX_MSG_SIZE 1024
#define CR_DEFAULT_SERVICE_ADDRESS "/var/run/criu_service.socket"
#endif /* __CR_SERVICE_CONST_H__ */
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
#include "protobuf/rpc.pb-c.h" #include "protobuf/rpc.pb-c.h"
#define CR_DEFAULT_SERVICE_ADDRESS "/var/run/criu_service.socket"
#define MAX_MSG_SIZE 1024
extern int cr_service(bool deamon_mode); extern int cr_service(bool deamon_mode);
extern int send_criu_dump_resp(int socket_fd, bool success, bool restored); extern int send_criu_dump_resp(int socket_fd, bool success, bool restored);
......
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