diff options
author | lawl <github@dumbinter.net> | 2021-04-05 15:08:20 +0200 |
---|---|---|
committer | lawl <github@dumbinter.net> | 2021-04-05 15:08:20 +0200 |
commit | 6ea788a0c0de72a387895c09d84e7a24061677eb (patch) | |
tree | bea6f46712f5a402fab9d38dce4f26e20ec0ffad /main.go | |
parent | 245455d508f21e888b18e168b0a930a32ab5a24d (diff) | |
download | noisetorch-6ea788a0c0de72a387895c09d84e7a24061677eb.tar.gz noisetorch-6ea788a0c0de72a387895c09d84e7a24061677eb.zip |
Refactor: Remove old method of removing rlimit for pulseaudio
Previously we had the capability to remove the rlimit on pulseaudio
by calling ourselves via pkexec to elevate privileges.
A while ago we switched to fully using capabilities.
We now remove the old legacy codepath.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 15 |
1 files changed, 0 insertions, 15 deletions
@@ -9,7 +9,6 @@ import ( "os" "path/filepath" "strings" - "syscall" "time" "github.com/BurntSushi/xgbutil" @@ -47,7 +46,6 @@ const appName = "NoiseTorch" func main() { - var pulsepid int var setcap bool var sinkName string var unload bool @@ -56,7 +54,6 @@ func main() { var threshold int var list bool - flag.IntVar(&pulsepid, "removerlimit", -1, "for internal use only") flag.BoolVar(&setcap, "setcap", false, "for internal use only") flag.StringVar(&sinkName, "s", "", "Use the specified source/sink device ID") flag.BoolVar(&loadInput, "i", false, "Load supressor for input. If no source device ID is specified the default pulse audio source is used.") @@ -74,18 +71,6 @@ func main() { os.Exit(0) } - //TODO:remove this after 0.10. Not required anymore after that. - //We don't remove it right now, since someone could have an old instance running that calls the updated binary - if pulsepid > 0 { - const MaxUint = ^uint64(0) - new := syscall.Rlimit{Cur: MaxUint, Max: MaxUint} - err := setRlimit(pulsepid, &new) - if err != nil { - os.Exit(1) - } - os.Exit(0) - } - date := time.Now().Format("2006_01_02_15_04_05") tmpdir := os.TempDir() f, err := os.OpenFile(filepath.Join(tmpdir, fmt.Sprintf("noisetorch-%s.log", date)), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644) |