Fix: avoid silent fatalities

demo: https://tcp.ac/i/JMSUc.gif
This commit is contained in:
kayos@tcp.direct 2024-06-17 00:30:24 -07:00
parent 3337efcb8f
commit 395f5ab6bc
No known key found for this signature in database
GPG key ID: 4B841471B4BEE979
13 changed files with 115 additions and 78 deletions

View file

@ -4,9 +4,9 @@ import (
"fmt"
"os"
"github.com/HikariKnight/ls-iommu/pkg/errorcheck"
"github.com/gookit/color"
"github.com/HikariKnight/quickpassthrough/internal/common"
"github.com/HikariKnight/quickpassthrough/internal/configs"
"github.com/HikariKnight/quickpassthrough/internal/lsiommu"
"github.com/HikariKnight/quickpassthrough/pkg/command"
@ -98,7 +98,7 @@ func viewGPU(config *configs.Config, ext ...int) {
if exists, _ := fileio.FileExist(config.Path.CMDLINE); exists {
// Delete it as we will have to make a new one anyway
err := os.Remove(config.Path.CMDLINE)
errorcheck.ErrorCheck(err, fmt.Sprintf("Could not remove %s", config.Path.CMDLINE))
common.ErrorCheck(err, fmt.Sprintf("Could not remove %s", config.Path.CMDLINE))
}
// Write initial kernel_arg file
@ -118,7 +118,7 @@ func viewGPU(config *configs.Config, ext ...int) {
if exists, _ := fileio.FileExist(config.Path.CMDLINE); exists {
// Delete it as we will have to make a new one anyway
err := os.Remove(config.Path.CMDLINE)
errorcheck.ErrorCheck(err, fmt.Sprintf("Could not remove %s", config.Path.CMDLINE))
common.ErrorCheck(err, fmt.Sprintf("Could not remove %s", config.Path.CMDLINE))
}
// Write initial kernel_arg file