return bret;
}
-static void strip_newline(char *p)
-{
- size_t len = strlen(p);
- if (len < 1)
- return;
- if (p[len-1] == '\n')
- p[len-1] = '\0';
-}
-
void mod_all_rdeps(struct lxc_container *c, bool inc)
{
struct lxc_container *p;
ERROR("badly formatted file %s", path);
goto out;
}
- strip_newline(lxcpath);
- strip_newline(lxcname);
+
+ remove_trailing_newlines(lxcpath);
+ remove_trailing_newlines(lxcname);
+
if ((p = lxc_container_new(lxcname, lxcpath)) == NULL) {
ERROR("Unable to find dependent container %s:%s",
lxcpath, lxcname);
}
#if HAVE_DECL_SECCOMP_SYSCALL_RESOLVE_NAME_ARCH
-static void remove_trailing_newlines(char *l)
-{
- char *p = l;
-
- while (*p)
- p++;
- while (--p >= l && *p == '\n')
- *p = '\0';
-}
-
static uint32_t get_v2_default_action(char *line)
{
uint32_t ret_action = -1;
return 0;
}
+
+void remove_trailing_newlines(char *l)
+{
+ char *p = l;
+
+ while (*p)
+ p++;
+
+ while (--p >= l && *p == '\n')
+ *p = '\0';
+}
extern size_t lxc_array_len(void **array);
extern void **lxc_append_null_to_array(void **array, size_t count);
+extern void remove_trailing_newlines(char *l);
/* initialize rand with urandom */
extern int randseed(bool);