2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

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: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Ruslan Kuprieiev
2013-12-18 01:04:39 +04:00
committed by Pavel Emelyanov
parent ba18a5e16c
commit a1e7407397
3 changed files with 11 additions and 6 deletions

View File

@@ -19,16 +19,17 @@
#include "log.h"
#include "pstree.h"
#include "cr-service.h"
#include "cr-service-const.h"
#include "sd-daemon.h"
unsigned int service_sk_ino = -1;
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;
len = read(socket_fd, buf, MAX_MSG_SIZE);
len = read(socket_fd, buf, CR_MAX_MSG_SIZE);
if (len == -1) {
pr_perror("Can't read request");
return -1;
@@ -45,7 +46,7 @@ static int recv_criu_msg(int socket_fd, CriuReq **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;
len = criu_resp__get_packed_size(msg);

View File

@@ -0,0 +1,7 @@
#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__ */

View File

@@ -3,9 +3,6 @@
#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 send_criu_dump_resp(int socket_fd, bool success, bool restored);