lxc/0081-lxc-Change-the-range-of-attach-timeout.patch
LiFeng 1e407c11a9 lxc: internal change
Signed-off-by: LiFeng <lifeng68@huawei.com>
2020-03-03 08:56:30 -05:00

79 lines
2.5 KiB
Diff

From 5cfdce31c3afcf8d688151e71e84d056f2229a27 Mon Sep 17 00:00:00 2001
From: tanyifeng <tanyifeng1@huawei.com>
Date: Mon, 8 Apr 2019 16:42:43 +0800
Subject: [PATCH 081/140] lxc: Change the range of attach timeout
Signed-off-by: wujing <wujing50@huawei.com>
Signed-off-by: LiFeng <lifeng68@huawei.com>
---
src/lxc/attach.c | 4 ++--
src/lxc/attach_options.h | 2 +-
src/lxc/tools/arguments.h | 2 +-
src/lxc/tools/lxc_attach.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/lxc/attach.c b/src/lxc/attach.c
index 79049c3..6480eb9 100644
--- a/src/lxc/attach.c
+++ b/src/lxc/attach.c
@@ -78,7 +78,7 @@ typedef enum {
static volatile attach_timeout_t g_attach_timeout_state = ATTACH_INIT;
struct attach_timeout_conf {
- unsigned int timeout;
+ int64_t timeout;
unsigned long long start_time;
pid_t pid;
};
@@ -1180,7 +1180,7 @@ out:
}
/* isulad: create attach timeout thread */
-static int create_attach_timeout_thread(unsigned int attach_timeout, pid_t pid)
+static int create_attach_timeout_thread(int64_t attach_timeout, pid_t pid)
{
int ret = 0;
pthread_t ptid;
diff --git a/src/lxc/attach_options.h b/src/lxc/attach_options.h
index 5e279ba..9744a2e 100644
--- a/src/lxc/attach_options.h
+++ b/src/lxc/attach_options.h
@@ -137,7 +137,7 @@ typedef struct lxc_attach_options_t {
int log_fd;
char *init_fifo[3]; /* isulad: default fifos for the start */
- unsigned int timeout;/* isulad: Seconds for waiting on a container to attach/exec before it is killed*/
+ int64_t timeout;/* isulad: Seconds for waiting on a container to attach/exec before it is killed*/
} lxc_attach_options_t;
/*! Default attach options to use */
diff --git a/src/lxc/tools/arguments.h b/src/lxc/tools/arguments.h
index 2fc90ad..de02aeb 100644
--- a/src/lxc/tools/arguments.h
+++ b/src/lxc/tools/arguments.h
@@ -70,7 +70,7 @@ struct lxc_arguments {
unsigned int start_timeout; /* isulad: Seconds for waiting on a container to start before it is killed*/
/* for lxc-attach */
- unsigned int attach_timeout;
+ int64_t attach_timeout;
/* for lxc-console */
unsigned int ttynum;
diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c
index 440c0bc..854b3a2 100644
--- a/src/lxc/tools/lxc_attach.c
+++ b/src/lxc/tools/lxc_attach.c
@@ -212,7 +212,7 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg)
ERROR("Error attach timeout parameter:%s.\n", arg);
return -1;
}
- args->attach_timeout = (unsigned int)atoi(arg);
+ args->attach_timeout = (unsigned int)atoll(arg);
break;
}
--
1.8.3.1