Optimize JobWatch for systemd 52/187952/4
authorseolheui, kim <s414.kim@samsung.com>
Thu, 30 Aug 2018 01:20:14 +0000 (10:20 +0900)
committerseolheui, kim <s414.kim@samsung.com>
Tue, 4 Sep 2018 07:33:42 +0000 (16:33 +0900)
Change-Id: Iaf10d01f97e4bec52963b098b56ed37d23709228
Signed-off-by: seolheui, kim <s414.kim@samsung.com>
server/internal-encryption.cpp

index 9c13f3de482413b930b360b94f5b1df201798e2f..e17a2e0a3bbda80eb95aad83d46676191c1a63ba 100644 (file)
@@ -191,9 +191,10 @@ void stopSystemdUnits()
                }
        }
 
-       auto stopUnit = [&systemDBus](const std::string &unit) {
+       JobWatch watch(systemDBus);
+
+       auto stopUnit = [&watch, &systemDBus](const std::string &unit) {
                INFO(SINK, "Stopping unit: " + unit);
-               JobWatch watch(systemDBus);
                const char* job = NULL;
                systemDBus.methodcall("org.freedesktop.systemd1",
                                                                "/org/freedesktop/systemd1",