From 72d317b4eeb9e0213d51bf89cf0c818ff8f15833 Mon Sep 17 00:00:00 2001 From: Kamil Iskra Date: Thu, 14 Dec 2017 17:09:10 -0600 Subject: [PATCH] Avoid C+11 constructs to work with gcc 4.9 --- src/container_manager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/container_manager.cpp b/src/container_manager.cpp index 14f53f8..75bf832 100644 --- a/src/container_manager.cpp +++ b/src/container_manager.cpp @@ -684,8 +684,8 @@ void Container_manager::alter_service_os(string command) #endif String_parser sp(command); sp.parse(); - vector allowed_keys( - {"cpus", "+cpus", "-cpus", "mems", "+mems", "-mems", "mem_migrate"}); + const char* initkeys[] = {"cpus", "+cpus", "-cpus", "mems", "+mems", "-mems", "mem_migrate"}; + vector allowed_keys(initkeys, initkeys + sizeof(initkeys) / sizeof(initkeys[0])); THROW_ON_BAD_INPUT_IF(sp.has_forbidden_keys(allowed_keys), "Invalid service_os alteration command"); @@ -769,7 +769,8 @@ void Container_manager::create_service_os(string command) "The node already has a service_os"); String_parser sp(command); sp.parse(); - vector allowed_keys({"cpus", "mems"}); + const char* initkeys[] = {"cpus", "mems"}; + vector allowed_keys(initkeys, initkeys + sizeof(initkeys) / sizeof(initkeys[0])); THROW_ON_BAD_INPUT_IF(sp.has_forbidden_keys(allowed_keys), "Invalid service_os creation command"); @@ -1099,7 +1100,7 @@ void Container_manager::exec(string command) /* Remove a single layer of backslashes. */ for (vector::iterator i = argvs.begin(); i != argvs.end(); ++i) - for (auto j = i->begin(); j != i->end(); ++j) + for (string::iterator j = i->begin(); j != i->end(); ++j) if (*j == '\\') i->erase(j); -- 2.26.2