chiark / gitweb /
service: set WATCHDOG_USEC environmen variable
authorMichael Olbrich <m.olbrich@pengutronix.de>
Wed, 8 Feb 2012 09:10:35 +0000 (10:10 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 8 Feb 2012 16:11:06 +0000 (17:11 +0100)
src/service.c

index 1631595..a190a73 100644 (file)
@@ -1735,6 +1735,12 @@ static int service_spawn(
                         goto fail;
                 }
 
+        if (s->watchdog_usec > 0)
+                if (asprintf(our_env + n_env++, "WATCHDOG_USEC=%llu", (unsigned long long) s->watchdog_usec) < 0) {
+                        r = -ENOMEM;
+                        goto fail;
+                }
+
         if (!(final_env = strv_env_merge(2,
                                          UNIT(s)->manager->environment,
                                          our_env,