<div dir="ltr"><div class="gmail_default" style="font-size:small">Ping?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 13, 2014 at 11:59 AM, <span dir="ltr"><<a href="mailto:gbellack@google.com" target="_blank">gbellack@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Garrison Bellack <<a href="mailto:gbellack@google.com">gbellack@google.com</a>><br>
<br>
When writing the system default for memory.limit_in_bytes (which is a LLONG_MAX)<br>
the write fails. The number is equivalent to -1 (unlimited). So during dump,<br>
store the number -1 instead.<br>
<br>
Change-Id: Iafccc96bf5dbade763d7addaeda24194616e4d5f<br>
Signed-off-by: Garrison Bellack <<a href="mailto:gbellack@google.com">gbellack@google.com</a>><br>
---<br>
cgroup.c | 9 +++++++++<br>
1 file changed, 9 insertions(+)<br>
<br>
diff --git a/cgroup.c b/cgroup.c<br>
index 7ac2dd8..f8dbbde 100644<br>
--- a/cgroup.c<br>
+++ b/cgroup.c<br>
@@ -288,6 +288,7 @@ static int read_cgroup_prop(struct cgroup_prop *property, const char *fpath)<br>
{<br>
char pbuf[PATH_MAX], buf[100];<br>
FILE *f;<br>
+ char *endptr;<br>
<br>
if (snprintf(pbuf, PATH_MAX, "%s/%s", fpath, property->name) >= PATH_MAX) {<br>
pr_err("snprintf output was truncated");<br>
@@ -315,6 +316,14 @@ static int read_cgroup_prop(struct cgroup_prop *property, const char *fpath)<br>
return -1;<br>
}<br>
<br>
+ if (strtoll(buf, &endptr, 10) == LLONG_MAX)<br>
+ strcpy(buf, "-1");<br>
+<br>
+ if (strcmp(endptr, "\n")) {<br>
+ pr_perror("Failed parsing %s, with strtoll\n", buf);<br>
+ return -1;<br>
+ }<br>
+<br>
property->value = xstrdup(buf);<br>
if (!property->value)<br>
return -1;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.0.rc2.206.gedb03e5<br>
<br>
_______________________________________________<br>
CRIU mailing list<br>
<a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
<a href="https://lists.openvz.org/mailman/listinfo/criu" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
</font></span></blockquote></div><br></div></div>