blob: 269eebb4c81fd5b35bdc5ccd42f06c1d3d7ea379 [file] [log] [blame]
Eric Carusocc7106c2017-04-27 14:22:42 -07001// Copyright 2017 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "debugd/src/variant_utils.h"
6
7namespace debugd {
8
Nicole Anderson-Aud9f0aed2020-12-22 17:16:25 +00009bool AddIntOption(SandboxedProcess* process,
Eric Carusocc7106c2017-04-27 14:22:42 -070010 const brillo::VariantDictionary& options,
11 const std::string& key,
12 const std::string& flag_name,
13 brillo::ErrorPtr* error) {
14 int value;
15 ParseResult result = GetOption(options, key, &value, error);
16 if (result == ParseResult::PARSED)
17 process->AddIntOption(flag_name, value);
18
19 return result != ParseResult::PARSE_ERROR;
20}
21
22} // namespace debugd