fix shim static check
Signed-off-by: gaohuatao <gaohuatao@huawei.com> (cherry picked from commit 546e9b771d35168d0255f8781dc08aa678fa2c1c) Signed-off-by: gaohuatao <gaohuatao@huawei.com>
This commit is contained in:
parent
4defb7b1b8
commit
71a185179b
@ -16,6 +16,7 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <linux/limits.h>
|
||||
#include <limits.h>
|
||||
#include "terminal.h"
|
||||
#include "common.h"
|
||||
@ -69,9 +70,13 @@ static int shim_rename_old_log_file(log_terminal *terminal)
|
||||
static int shim_dump_log_file(log_terminal *terminal)
|
||||
{
|
||||
int ret;
|
||||
char *file_newname;
|
||||
char *file_newname = NULL;
|
||||
size_t len_path = strlen(terminal->log_path) + sizeof(".1");
|
||||
|
||||
if (len_path > PATH_MAX) {
|
||||
return SHIM_ERR;
|
||||
}
|
||||
|
||||
/* isulad: rotate old log file first */
|
||||
ret = shim_rename_old_log_file(terminal);
|
||||
if (ret != 0) {
|
||||
|
||||
@ -24,10 +24,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 4096
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
uint64_t log_maxsize;
|
||||
char *log_path;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user