diff options
author | lawl <github@dumbinter.net> | 2020-07-21 18:58:10 +0200 |
---|---|---|
committer | lawl <github@dumbinter.net> | 2020-07-21 18:58:10 +0200 |
commit | 9bcb2a0c8dc64ad73c707502b1991f13b71c4fef (patch) | |
tree | 5cb0bae577f3d00178728dafdb3f147862e4630f /rlimit.go | |
parent | 3fc46d2d30ca26eaece8d1dac15d556b0a6f1f7f (diff) | |
download | noisetorch-9bcb2a0c8dc64ad73c707502b1991f13b71c4fef.tar.gz noisetorch-9bcb2a0c8dc64ad73c707502b1991f13b71c4fef.zip |
Respect PULSE_RUNTME_PATH and PULSE_COOKIE
Diffstat (limited to 'rlimit.go')
-rw-r--r-- | rlimit.go | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1,22 +1,25 @@ package main import ( - "fmt" "io/ioutil" "log" "os" "os/exec" - "path/filepath" "strconv" "strings" "syscall" "unsafe" + + "github.com/lawl/pulseaudio" ) const rlimitRTTime = 15 func getPulsePid() (int, error) { - pulsepidfile := filepath.Join(xdgOrFallback("XDG_RUNTIME_DIR", fmt.Sprintf("/run/user/%d", os.Getuid())), "pulse/pid") + pulsepidfile, err := pulseaudio.RuntimePath("pid") + if err != nil { + return 0, err + } pidbuf, err := ioutil.ReadFile(pulsepidfile) if err != nil { return 0, err |