Clean up warning in process_restart_timer.
authorDavin McCall <davmac@davmac.org>
Mon, 8 Jan 2018 19:56:43 +0000 (19:56 +0000)
committerDavin McCall <davmac@davmac.org>
Mon, 8 Jan 2018 19:56:43 +0000 (19:56 +0000)
Initialise the service pointer via the constructor to avoid warning.

src/service.cc
src/service.h

index 43156823171f03b0a9dc2c21d6b9b38bcd911f48..1de721254438b484108d12500ea3dbbfa1a17409 100644 (file)
@@ -1402,7 +1402,7 @@ base_process_service::base_process_service(service_set *sset, string name,
         std::list<std::pair<unsigned,unsigned>> &command_offsets,
         const std::list<prelim_dep> &deplist_p)
      : service_record(sset, name, service_type_p, deplist_p), child_listener(this),
-       child_status_listener(this)
+       child_status_listener(this), restart_timer(this)
 {
     program_name = std::move(command);
     exec_arg_parts = separate_args(program_name, command_offsets);
index 0e05da42c8e8ff954534bf13e7f50277a79d30fb..2cde697b759cdc74ecc0aa8d616030c7c30b4016 100644 (file)
@@ -610,7 +610,8 @@ class process_restart_timer : public eventloop_t::timer_impl<process_restart_tim
     public:
     base_process_service * service;
 
-    process_restart_timer()
+    process_restart_timer(base_process_service *service_p)
+        : service(service_p)
     {
     }