Remove panic-prone optional beep helpers
This commit is contained in:
committed by
Brandon McGinty
parent
51d62c3acb
commit
c3fe4f88f3
@@ -261,7 +261,7 @@ Priority 3: configuration, UI, and binding hardening
|
|||||||
Add checked wrapper operations for lifecycle-critical calls and surface
|
Add checked wrapper operations for lifecycle-critical calls and surface
|
||||||
actionable errors to Barnard.
|
actionable errors to Barnard.
|
||||||
|
|
||||||
34. Beep helpers panic when the external command is absent
|
[x] 34. Beep helpers panic when the external command is absent
|
||||||
Files: ui.go, gumble/gumbleopenal/stream.go
|
Files: ui.go, gumble/gumbleopenal/stream.go
|
||||||
Both helpers panic on exec failure. Return/log an error or remove unused
|
Both helpers panic on exec failure. Return/log an error or remove unused
|
||||||
helpers; a missing optional beep binary must not terminate Barnard.
|
helpers; a missing optional beep binary must not terminate Barnard.
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
"math"
|
"math"
|
||||||
"os/exec"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
@@ -46,16 +45,6 @@ var (
|
|||||||
ErrOutputDevice = errors.New("gumbleopenal: invalid output device or parameters")
|
ErrOutputDevice = errors.New("gumbleopenal: invalid output device or parameters")
|
||||||
)
|
)
|
||||||
|
|
||||||
func beep() {
|
|
||||||
cmd := exec.Command("beep")
|
|
||||||
cmdout, err := cmd.Output()
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
if cmdout != nil {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type renderCommand struct {
|
type renderCommand struct {
|
||||||
fn func()
|
fn func()
|
||||||
done chan struct{}
|
done chan struct{}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -24,16 +23,6 @@ const (
|
|||||||
uiViewAdmin = "admin"
|
uiViewAdmin = "admin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Beep() {
|
|
||||||
cmd := exec.Command("beep")
|
|
||||||
cmdout, err := cmd.Output()
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
if cmdout != nil {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func esc(str string) string {
|
func esc(str string) string {
|
||||||
return sanitize.HTML(str)
|
return sanitize.HTML(str)
|
||||||
}
|
}
|
||||||
@@ -42,10 +31,6 @@ func (b *Barnard) Notify(event string, who string, what string) {
|
|||||||
b.notifyChannel <- []string{event, who, what}
|
b.notifyChannel <- []string{event, who, what}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Barnard) Beep() {
|
|
||||||
Beep()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *Barnard) SetSelectedUser(user *gumble.User) {
|
func (b *Barnard) SetSelectedUser(user *gumble.User) {
|
||||||
b.selectedUser = user
|
b.selectedUser = user
|
||||||
if user == nil {
|
if user == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user