[Devel] [libvzctl PATCH 1/2] util: create_ve_run_dir() helper introduced
Stanislav Kinsburskiy
skinsbursky at virtuozzo.com
Fri Jul 28 11:43:20 MSK 2017
Will be used to create root run directory.
Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
lib/util.c | 5 +++++
lib/util.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/lib/util.c b/lib/util.c
index f0dacaa..46e4c06 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -2596,6 +2596,11 @@ void p_close(int p[2])
close(p[1]);
}
+int create_ve_run_dir(void)
+{
+ return make_dir(VZCTL_VE_RUN_DIR, 1);
+}
+
void get_init_pid_path(const ctid_t ctid, char *path)
{
sprintf(path, VZCTL_VE_RUN_DIR "/%s" VZCTL_VE_INIT_PID_FILE_EXT, ctid);
diff --git a/lib/util.h b/lib/util.h
index 9fc91a3..c96eb59 100644
--- a/lib/util.h
+++ b/lib/util.h
@@ -225,6 +225,7 @@ const char *get_devname(const char *device);
int get_dir_list(list_head_t *head, const char *root, int level);
void p_close(int p[2]);
int read_p(int fd);
+int create_ve_run_dir(void);
void get_init_pid_path(const ctid_t ctid, char *path);
int write_init_pid(const ctid_t ctid, pid_t pid);
int read_init_pid(const ctid_t ctid, pid_t *pid);
More information about the Devel
mailing list