[Devel,libvzctl,1/2] util: create_ve_run_dir() helper introduced

Submitted by Stanislav Kinsburskiy on July 28, 2017, 8:43 a.m.

Details

Message ID 20170728084320.7659.32532.stgit@skinsbursky-vz7.qa.sw.ru
State New
Series "env_create: create CT run root in VE#0 context"
Headers show

Commit Message

Stanislav Kinsburskiy July 28, 2017, 8:43 a.m.
Will be used to create root run directory.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
 lib/util.c |    5 +++++
 lib/util.h |    1 +
 2 files changed, 6 insertions(+)

Patch hide | download patch | download mbox

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);