Unverified Commit b61b6638 authored by Yossi Gottlieb's avatar Yossi Gottlieb Committed by GitHub
Browse files

Fix oom-score-adj on older distros. (#7724)

Don't assume `ps` handles `-h` to display output without headers and
manually trim headers line from output.
parent ee4a15aa
...@@ -16,8 +16,8 @@ if {$system_name eq {linux}} { ...@@ -16,8 +16,8 @@ if {$system_name eq {linux}} {
proc get_child_pid {} { proc get_child_pid {} {
set pid [srv 0 pid] set pid [srv 0 pid]
set fd [open "|ps --ppid $pid -o pid -h" "r"] set fd [open "|ps --ppid $pid -o pid" "r"]
set child_pid [string trim [read $fd]] set child_pid [string trim [lindex [split [read $fd] \n] 1]]
close $fd close $fd
return $child_pid return $child_pid
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment