<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">&lt;<a href="mailto:gbellack@google.com" target="_blank">gbellack@google.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Garrison Bellack &lt;<a href="mailto:gbellack@google.com">gbellack@google.com</a>&gt;<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 &lt;<a href="mailto:gbellack@google.com">gbellack@google.com</a>&gt;<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, &quot;%s/%s&quot;, fpath, property-&gt;name) &gt;= PATH_MAX) {<br>
                pr_err(&quot;snprintf output was truncated&quot;);<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, &amp;endptr, 10) == LLONG_MAX)<br>
+               strcpy(buf, &quot;-1&quot;);<br>
+<br>
+       if (strcmp(endptr, &quot;\n&quot;)) {<br>
+               pr_perror(&quot;Failed parsing %s, with strtoll\n&quot;, buf);<br>
+               return -1;<br>
+       }<br>
+<br>
        property-&gt;value = xstrdup(buf);<br>
        if (!property-&gt;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>