提交 f0476684 编写于 作者: L lifeng68

clean code: remove unused code

Signed-off-by: Nlifeng68 <lifeng68@huawei.com>
上级 3174fdcb
...@@ -47,6 +47,13 @@ ...@@ -47,6 +47,13 @@
#include "container_operator.h" #include "container_operator.h"
#include "io_handler.h" #include "io_handler.h"
struct container_log_config {
char *driver;
char *path;
int rotate;
int64_t size;
};
static int do_append_process_exec_env(const char **default_env, defs_process *spec) static int do_append_process_exec_env(const char **default_env, defs_process *spec)
{ {
int ret = 0; int ret = 0;
...@@ -295,8 +302,7 @@ err_out: ...@@ -295,8 +302,7 @@ err_out:
return NULL; return NULL;
} }
static int exec_container(container_t *cont, const char *runtime, char * const console_fifos[], static int exec_container(container_t *cont, const char *runtime, char * const console_fifos[], defs_process_user *puser,
defs_process_user *puser,
const container_exec_request *request, int *exit_code) const container_exec_request *request, int *exit_code)
{ {
int ret = 0; int ret = 0;
...@@ -2055,6 +2061,20 @@ static bool support_logs(struct container_log_config *log_config) ...@@ -2055,6 +2061,20 @@ static bool support_logs(struct container_log_config *log_config)
return true; return true;
} }
static void container_log_config_free(struct container_log_config *conf)
{
if (conf == NULL) {
return;
}
free(conf->path);
conf->path = NULL;
free(conf->driver);
conf->driver = NULL;
conf->rotate = 0;
conf->size = 0;
free(conf);
}
static int container_logs_cb(const struct isulad_logs_request *request, stream_func_wrapper *stream, static int container_logs_cb(const struct isulad_logs_request *request, stream_func_wrapper *stream,
struct isulad_logs_response **response) struct isulad_logs_response **response)
{ {
......
...@@ -233,20 +233,6 @@ void isulad_logs_response_free(struct isulad_logs_response *response) ...@@ -233,20 +233,6 @@ void isulad_logs_response_free(struct isulad_logs_response *response)
free(response); free(response);
} }
void container_log_config_free(struct container_log_config *conf)
{
if (conf == NULL) {
return;
}
free(conf->path);
conf->path = NULL;
free(conf->driver);
conf->driver = NULL;
conf->rotate = 0;
conf->size = 0;
free(conf);
}
/* events copy */ /* events copy */
int event_copy(const struct isulad_events_format *src, struct isulad_events_format *dest) int event_copy(const struct isulad_events_format *src, struct isulad_events_format *dest)
{ {
......
...@@ -199,35 +199,6 @@ struct isulad_container_resize_response { ...@@ -199,35 +199,6 @@ struct isulad_container_resize_response {
char *errmsg; char *errmsg;
}; };
struct isulad_image_info {
char *imageref;
char *type;
char *digest;
int64_t created; /* seconds */
int32_t created_nanos;
int64_t size; /* Bytes */
};
struct isulad_create_image_request {
struct isulad_image_info image_info;
};
struct isulad_create_image_response {
uint32_t cc;
uint32_t server_errono;
struct isulad_image_info image_info;
char *errmsg;
};
struct container_log_config {
char *driver;
char *path;
int rotate;
int64_t size;
};
void container_log_config_free(struct container_log_config *conf);
void isulad_events_request_free(struct isulad_events_request *request); void isulad_events_request_free(struct isulad_events_request *request);
void isulad_copy_from_container_request_free(struct isulad_copy_from_container_request *request); void isulad_copy_from_container_request_free(struct isulad_copy_from_container_request *request);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册