| Index: src/platform/metrics_daemon/metrics_daemon.cc
|
| diff --git a/src/platform/metrics_daemon/metrics_daemon.cc b/src/platform/metrics_daemon/metrics_daemon.cc
|
| index 8f58ca828fc5e85b348e2c915a0807149b3f48e0..d7ff69cb899e45cd9aa0d25dd38195814b9dbfa4 100644
|
| --- a/src/platform/metrics_daemon/metrics_daemon.cc
|
| +++ b/src/platform/metrics_daemon/metrics_daemon.cc
|
| @@ -10,6 +10,7 @@
|
| #include <stdlib.h>
|
| #include <sys/file.h>
|
| #include <sys/stat.h>
|
| +#include <unistd.h>
|
|
|
| extern "C" {
|
| #include "marshal_void__string_boxed.h"
|
| @@ -29,9 +30,11 @@ MetricsDaemon::network_states_[MetricsDaemon::kNumberNetworkStates] = {
|
| #include "network_states.h"
|
| };
|
|
|
| -void MetricsDaemon::Run(bool testing) {
|
| +void MetricsDaemon::Run(bool run_as_daemon, bool testing) {
|
| Init(testing);
|
| - Loop();
|
| + if (!run_as_daemon || daemon(0, 0) == 0) {
|
| + Loop();
|
| + }
|
| }
|
|
|
| void MetricsDaemon::Init(bool testing) {
|
|
|