提交 c1768dbe 编写于 作者: L lifeng68

refact: rename types_def.* to utils_timestamp.*

Signed-off-by: Nlifeng68 <lifeng68@huawei.com>
上级 921307f1
......@@ -87,7 +87,7 @@ install(FILES src/client/connect/isula_connect.h
DESTINATION include/isulad)
install(FILES src/container_def.h
DESTINATION include/isulad)
install(FILES src/cutils/types_def.h
install(FILES src/cutils/utils_timestamp.h
DESTINATION include/isulad)
install(FILES src/cutils/error.h
DESTINATION include/isulad)
......
......@@ -73,11 +73,11 @@ install -m 0755 ./src/isulad %{buildroot}/%{_bindir}/isulad
install -d $RPM_BUILD_ROOT/%{_includedir}/isulad
install -m 0644 ../src/client/libisula.h %{buildroot}/%{_includedir}/isulad/libisula.h
install -m 0644 ../src/client/connect/isula_connect.h %{buildroot}/%{_includedir}/isulad/isula_connect.h
install -m 0644 ../src/container_def.h %{buildroot}/%{_includedir}/isulad/container_def.h
install -m 0644 ../src/cutils/types_def.h %{buildroot}/%{_includedir}/isulad/types_def.h
install -m 0644 ../src/cutils/error.h %{buildroot}/%{_includedir}/isulad/error.h
install -m 0644 ../src/daemon/engines/engine.h %{buildroot}/%{_includedir}/isulad/engine.h
install -m 0644 ../src/client/connect/isula_connect.h %{buildroot}/%{_includedir}/isulad/isula_connect.h
install -m 0644 ../src/container_def.h %{buildroot}/%{_includedir}/isulad/container_def.h
install -m 0644 ../src/cutils/utils_timestamp.h %{buildroot}/%{_includedir}/isulad/utils_timestamp.h
install -m 0644 ../src/cutils/error.h %{buildroot}/%{_includedir}/isulad/error.h
install -m 0644 ../src/daemon/engines/engine.h %{buildroot}/%{_includedir}/isulad/engine.h
install -d $RPM_BUILD_ROOT/%{_sysconfdir}/isulad
install -m 0640 ../src/contrib/config/daemon.json %{buildroot}/%{_sysconfdir}/isulad/daemon.json
......
......@@ -22,7 +22,7 @@
#include "isula_libutils/container_path_stat.h"
#include "isula_libutils/json_common.h"
#include "console.h"
#include "types_def.h"
#include "utils_timestamp.h"
#ifdef __cplusplus
extern "C" {
......
......@@ -59,8 +59,8 @@ struct lengths {
};
const char * const g_containerstatusstr[] = { "unknown", "inited", "starting", "running",
"exited", "paused", "restarting"
};
"exited", "paused", "restarting"
};
struct filter_field {
char *name;
......
......@@ -12,7 +12,7 @@
* Create: 2018-11-1
* Description: provide typedef functions
********************************************************************************/
#include "types_def.h"
#include "utils_timestamp.h"
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
......@@ -154,8 +154,7 @@ bool get_time_buffer_help(const types_timestamp_t *timestamp, char *timebuffer,
}
if (local_utc) {
nret = snprintf(timebuffer + strlen(timebuffer),
maxsize - strlen(timebuffer), ".%09dZ", nanos);
nret = snprintf(timebuffer + strlen(timebuffer), maxsize - strlen(timebuffer), ".%09dZ", nanos);
goto out;
}
......@@ -168,11 +167,10 @@ bool get_time_buffer_help(const types_timestamp_t *timestamp, char *timebuffer,
}
if (tm_zone >= 0) {
nret = snprintf(timebuffer + strlen(timebuffer),
maxsize - strlen(timebuffer), ".%09d+%02d:00", nanos, tm_zone);
nret = snprintf(timebuffer + strlen(timebuffer), maxsize - strlen(timebuffer), ".%09d+%02d:00", nanos, tm_zone);
} else {
nret = snprintf(timebuffer + strlen(timebuffer),
maxsize - strlen(timebuffer), ".%09d-%02d:00", nanos, -tm_zone);
nret = snprintf(timebuffer + strlen(timebuffer), maxsize - strlen(timebuffer), ".%09d-%02d:00", nanos,
-tm_zone);
}
out:
......@@ -964,4 +962,3 @@ int to_unix_nanos_from_str(const char *str, int64_t *nanos)
*nanos = mktime(&tm) * Time_Second + nano;
return 0;
}
......@@ -23,15 +23,15 @@
#include "isula_libutils/registry_manifest_schema1.h"
#include "isula_libutils/image_manifest_v1_compatibility.h"
#include "registry_type.h"
#include "types_def.h"
#include "utils_timestamp.h"
#ifdef __cplusplus
extern "C" {
#endif
void free_items_not_inherit(docker_image_config_v2 *config);
int add_rootfs_and_history(const layer_blob *layers, size_t layers_len,
const registry_manifest_schema1 *manifest, docker_image_config_v2 *config);
int add_rootfs_and_history(const layer_blob *layers, size_t layers_len, const registry_manifest_schema1 *manifest,
docker_image_config_v2 *config);
types_timestamp_t created_to_timestamp(char *created);
#ifdef __cplusplus
......@@ -39,4 +39,3 @@ types_timestamp_t created_to_timestamp(char *created);
#endif
#endif /* __OCI_REGISTRY_COMMON_H */
......@@ -19,13 +19,13 @@
#include <stdint.h>
#include <time.h>
#include "types_def.h"
#include "utils_timestamp.h"
#include "utils_images.h"
// 8 is enough for challenge, usually only one challenge is provided.
#define CHALLENGE_MAX 8
#define REGISTRY_TMP_DIR IMAGE_TMP_PATH"registry-XXXXXX"
#define REGISTRY_TMP_DIR IMAGE_TMP_PATH "registry-XXXXXX"
#define MAX_LAYER_NUM 125
#define ROOTFS_TYPE "layers"
......
......@@ -19,7 +19,7 @@
#include <string.h>
#include <pthread.h>
#include "storage.h"
#include "types_def.h"
#include "utils_timestamp.h"
#include "map.h"
#include "linked_list.h"
#include "image_type.h"
......
......@@ -25,7 +25,7 @@
#include "driver.h"
#include "linked_list.h"
#include "map.h"
#include "types_def.h"
#include "utils_timestamp.h"
#include "utils.h"
#include "util_atomic.h"
#include "utils_array.h"
......
......@@ -18,7 +18,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "types_def.h"
#include "utils_timestamp.h"
#include "isula_libutils/storage_image.h"
#include "isula_libutils/storage_rootfs.h"
#include "isula_libutils/imagetool_images_list.h"
......
......@@ -17,7 +17,7 @@
#include <stdbool.h>
#include <stdint.h>
#include "types_def.h"
#include "utils_timestamp.h"
#include "container_def.h"
#ifdef __cplusplus
......
......@@ -15,38 +15,29 @@
#ifndef __ISULAD_HEALTH_CHECK_H_
#define __ISULAD_HEALTH_CHECK_H_
#include "types_def.h"
#include "utils_timestamp.h"
#include "isula_libutils/container_config_v2.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_OUTPUT_LEN 4096
#define MAX_OUTPUT_LEN 4096
#define DEFAULT_PROBE_INTERVAL (30 * Time_Second)
#define DEFAULT_PROBE_TIMEOUT (30 * Time_Second)
#define DEFAULT_START_PERIOD (0 * Time_Second)
#define DEFAULT_PROBE_RETRIES 3
#define MAX_LOG_ENTRIES 5
#define EXIT_STATUS_HEALTHY 0
#define DEFAULT_PROBE_TIMEOUT (30 * Time_Second)
#define DEFAULT_START_PERIOD (0 * Time_Second)
#define DEFAULT_PROBE_RETRIES 3
#define MAX_LOG_ENTRIES 5
#define EXIT_STATUS_HEALTHY 0
#define NO_HEALTH_CHECK "none"
#define HEALTH_STARTING "starting"
#define HEALTHY "healthy"
#define UNHEALTHY "unhealthy"
#define HEALTHY "healthy"
#define UNHEALTHY "unhealthy"
typedef enum {
CMD,
CMD_SHELL,
HEALTH_NONE,
HEALTH_UNKNOWN
} health_probe_t;
typedef enum { CMD, CMD_SHELL, HEALTH_NONE, HEALTH_UNKNOWN } health_probe_t;
typedef enum {
MONITOR_IDLE = 0,
MONITOR_INTERVAL = 1,
MONITOR_STOP = 2
} health_check_monitor_status_t;
typedef enum { MONITOR_IDLE = 0, MONITOR_INTERVAL = 1, MONITOR_STOP = 2 } health_check_monitor_status_t;
typedef struct health_check_manager {
pthread_mutex_t mutex;
......@@ -65,5 +56,3 @@ int64_t timeout_with_default(int64_t configured_value, int64_t default_value);
#endif
#endif /* __ISULAD_HEALTH_CHECK_H_ */
......@@ -51,11 +51,11 @@
static const char * const g_system_caps[] = { "SYS_BOOT", "SETPCAP", "NET_RAW", "NET_BIND_SERVICE",
#ifdef CAP_AUDIT_WRITE
"AUDIT_WRITE",
"AUDIT_WRITE",
#endif
"DAC_OVERRIDE", "SETFCAP", "SETGID", "SETUID", "MKNOD", "CHOWN",
"FOWNER", "FSETID", "KILL", "SYS_CHROOT"
};
"DAC_OVERRIDE", "SETFCAP", "SETGID", "SETUID", "MKNOD", "CHOWN",
"FOWNER", "FSETID", "KILL", "SYS_CHROOT"
};
static int append_capability(char ***dstcaps, size_t *dstcaps_len, const char *cap)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册