[CRIU] [PATCH] pstree: Define RLIM_NLIMITS
Cyrill Gorcunov
gorcunov at openvz.org
Fri Mar 14 07:38:45 PDT 2014
On PI machine we've got
| CC protobuf.o
| pstree.c: In function ‘core_entry_alloc’:
| pstree.c:36:10: error: ‘RLIM_NLIMITS’ undeclared (first use in this function)
due to old kernel headers. Note I've dropped off
BUG_ON here to localize all things in pstree code,
no need to sprinkle constants.
Reported-by: Pavel Emelyanov <xemul at parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
cr-dump.c | 2 --
pstree.c | 4 ++++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/cr-dump.c b/cr-dump.c
index bed76ed099c1..0111115448db 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -321,8 +321,6 @@ static int dump_task_rlimits(int pid, TaskRlimitsEntry *rls)
{
int res;
- BUG_ON(rls->n_rlimits < RLIM_NLIMITS);
-
for (res = 0; res <rls->n_rlimits ; res++) {
struct rlimit lim;
diff --git a/pstree.c b/pstree.c
index 85b82f2efeea..b35c3c4f7275 100644
--- a/pstree.c
+++ b/pstree.c
@@ -22,6 +22,10 @@ void core_entry_free(CoreEntry *core)
xfree(core);
}
+#ifndef RLIM_NLIMITS
+# define RLIM_NLIMITS 16
+#endif
+
CoreEntry *core_entry_alloc(int th, int tsk)
{
size_t sz;
--
1.8.3.1
More information about the CRIU
mailing list