summaryrefslogtreecommitdiff
path: root/dbus
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2016-06-30 13:57:29 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2016-06-30 13:57:29 +0100
commitb5bef9dc1647b0516d199e0575e6f2db5a387817 (patch)
tree0eaef6b8a08d2c8a21840cbf83f8b76e973f98ad /dbus
parent727c5429ba94aad935ff7f483fcb350aee00c1dd (diff)
parent2fe59f1892825ced87c45ae25d9f5795b1d735b6 (diff)
downloaddbus-1.10-ci.tar.gz
Merge branch 'dbus-1.10' into dbus-1.10-cidbus-1.10-ci
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus-spawn.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/dbus/dbus-spawn.c b/dbus/dbus-spawn.c
index ddd254dc..45f3d87d 100644
--- a/dbus/dbus-spawn.c
+++ b/dbus/dbus-spawn.c
@@ -1354,6 +1354,26 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
}
else if (grandchild_pid == 0)
{
+#ifdef __linux__
+ int fd = -1;
+
+#ifdef O_CLOEXEC
+ fd = open ("/proc/self/oom_score_adj", O_WRONLY | O_CLOEXEC);
+#endif
+
+ if (fd < 0)
+ {
+ fd = open ("/proc/self/oom_score_adj", O_WRONLY);
+ _dbus_fd_set_close_on_exec (fd);
+ }
+
+ if (fd >= 0)
+ {
+ if (write (fd, "0", sizeof (char)) < 0)
+ _dbus_warn ("writing oom_score_adj error: %s\n", strerror (errno));
+ _dbus_close (fd, NULL);
+ }
+#endif
/* Go back to ignoring SIGPIPE, since it's evil
*/
signal (SIGPIPE, SIG_IGN);