activation: set children oom_score_adj to 0 35/75235/1
authorHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 17 Jun 2016 06:24:33 +0000 (15:24 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 17 Jun 2016 06:24:33 +0000 (15:24 +0900)
Change-Id: Ida85bcb12ea8ce0a1af948fb0f1600ed21f3323e
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
dbus/dbus-spawn.c

index ddd254d..d58d798 100644 (file)
@@ -1353,7 +1353,17 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter          **sitter_p,
           _dbus_assert_not_reached ("Got to code after write_err_and_exit()");
        }
       else if (grandchild_pid == 0)
-      {
+        {
+          #ifdef __linux__
+         int fd = open ("/proc/self/oom_score_adj", O_WRONLY | O_CLOEXEC);
+         
+          if (fd >= 0)
+          {
+            write (fd, "0", sizeof (char));
+            _dbus_close (fd, NULL);
+          }
+         #endif
+
           /* Go back to ignoring SIGPIPE, since it's evil
            */
           signal (SIGPIPE, SIG_IGN);