]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
utils: move remove_trailing_slashes to utils
authorQiang Huang <h.huangqiang@huawei.com>
Tue, 24 Sep 2013 07:27:53 +0000 (15:27 +0800)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 24 Sep 2013 14:37:18 +0000 (09:37 -0500)
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c
src/lxc/utils.c
src/lxc/utils.h

index ea5a84efc61238245a658fb797c29289c3193629..f5d41b30677050103ca3e27148060e75fae94a47 100644 (file)
@@ -69,13 +69,6 @@ static bool file_exists(char *f)
        return stat(f, &statbuf) == 0;
 }
 
-static void remove_trailing_slashes(char *p)
-{
-       int l = strlen(p);
-       while (--l >= 0 && (p[l] == '/' || p[l] == '\n'))
-               p[l] = '\0';
-}
-
 /*
  * A few functions to help detect when a container creation failed.
  * If a container creation was killed partway through, then trying
index a908b5cafb383dbfc1e4382d31d95a5f334b80a8..dc94a3cdc0671664f924b3ae86465e033581d592 100644 (file)
@@ -211,6 +211,13 @@ extern int mkdir_p(const char *dir, mode_t mode)
        return 0;
 }
 
+extern void remove_trailing_slashes(char *p)
+{
+       int l = strlen(p);
+       while (--l >= 0 && (p[l] == '/' || p[l] == '\n'))
+               p[l] = '\0';
+}
+
 static char *copy_global_config_value(char *p)
 {
        int len = strlen(p);
index 55f98fa87557b026e466d2397ead3a758fc65588..87a914b9b0ad8e1dc8e88e8512ef7fcc221545b4 100644 (file)
@@ -37,6 +37,7 @@ extern int lxc_rmdir_onedev(char *path);
 extern int lxc_setup_fs(void);
 extern int get_u16(unsigned short *val, const char *arg, int base);
 extern int mkdir_p(const char *dir, mode_t mode);
+extern void remove_trailing_slashes(char *p);
 extern const char *get_rundir(void);
 
 /*