mirror of https://github.com/jetkvm/kvm.git
fix: Address linting errors in audio code
- Check SetReadDeadline error in IPC client - Explicitly ignore Kill() error (process may be dead) - Remove init() function and rely on explicit ExtractEmbeddedBinaries() call
This commit is contained in:
parent
7872ddc8fc
commit
141e2f9099
|
|
@ -78,13 +78,3 @@ func GetAudioOutputBinaryPath() string {
|
|||
func GetAudioInputBinaryPath() string {
|
||||
return audioInputBinPath
|
||||
}
|
||||
|
||||
// init ensures binaries are extracted when package is imported
|
||||
func init() {
|
||||
// Extract binaries on package initialization
|
||||
// This ensures binaries are available before supervisors start
|
||||
if err := ExtractEmbeddedBinaries(); err != nil {
|
||||
// Log error but don't panic - let caller handle initialization failure
|
||||
fmt.Fprintf(os.Stderr, "Warning: Failed to extract embedded audio binaries: %v\n", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,9 @@ func (c *IPCClient) ReadMessage() (uint8, []byte, error) {
|
|||
}
|
||||
|
||||
// Set read deadline
|
||||
c.conn.SetReadDeadline(time.Now().Add(readTimeout))
|
||||
if err := c.conn.SetReadDeadline(time.Now().Add(readTimeout)); err != nil {
|
||||
return 0, nil, fmt.Errorf("failed to set read deadline: %w", err)
|
||||
}
|
||||
|
||||
// Read 9-byte header
|
||||
var header [ipcHeaderSize]byte
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ func (s *Supervisor) Stop() {
|
|||
|
||||
// Kill process if running
|
||||
if s.cmd != nil && s.cmd.Process != nil {
|
||||
s.cmd.Process.Kill()
|
||||
_ = s.cmd.Process.Kill() // Ignore error, process may already be dead
|
||||
}
|
||||
|
||||
// Wait for supervision loop to exit
|
||||
|
|
|
|||
Loading…
Reference in New Issue