From bb8d0909226b6ec25fd9b5eb652171f461e872b0 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 6 Nov 2012 09:35:47 +0100 Subject: [PATCH] Resolve possible ambiguity of 'strcmp' --- os/include/init/child_policy.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/os/include/init/child_policy.h b/os/include/init/child_policy.h index 505167aaa..8bcbb53cf 100644 --- a/os/include/init/child_policy.h +++ b/os/include/init/child_policy.h @@ -94,18 +94,22 @@ namespace Init { { using namespace Genode; - if (strcmp(session, "PD") != 0) + /* + * Specify 'Genode' namespace to remove possible ambiguity of + * 'strcmp' when including the header along with libc headers. + */ + if (Genode::strcmp(session, "PD") != 0) return; - char path_buf[Parent::Session_args::MAX_SIZE]; - Arg_string::find_arg(args, "root").string(path_buf, sizeof(path_buf), ""); + char path[Parent::Session_args::MAX_SIZE]; + Arg_string::find_arg(args, "root").string(path, sizeof(path), ""); - char value_buf[Parent::Session_args::MAX_SIZE]; - Genode::snprintf(value_buf, sizeof(value_buf), + char value[Parent::Session_args::MAX_SIZE]; + Genode::snprintf(value, sizeof(value), "\"%s%s\"", - _root_prefix, path_buf); + _root_prefix, path); - Arg_string::set_arg(args, args_len, "root", value_buf); + Arg_string::set_arg(args, args_len, "root", value); } };