Eric Caruso | cc7106c | 2017-04-27 14:22:42 -0700 | [diff] [blame] | 1 | // 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 | |
| 7 | namespace debugd { |
| 8 | |
Nicole Anderson-Au | d9f0aed | 2020-12-22 17:16:25 +0000 | [diff] [blame] | 9 | bool AddIntOption(SandboxedProcess* process, |
Eric Caruso | cc7106c | 2017-04-27 14:22:42 -0700 | [diff] [blame] | 10 | 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 |