Fix CI suite warnings

This commit is contained in:
AlexSSD7 2023-09-27 13:42:48 +01:00
commit 033d24dbde
3 changed files with 5 additions and 5 deletions

View file

@ -91,7 +91,7 @@ func CheckRunAsRoot() (bool, error) {
}
func GetDeviceLogicalBlockSize(devPath string) (uint64, error) {
fd, err := os.Open(devPath)
fd, err := os.Open(filepath.Clean(devPath))
if err != nil {
return 0, errors.Wrap(err, "open device")
}

View file

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// go:build linux
//go:build linux
package osspecifics
@ -27,10 +27,10 @@ import (
func getDeviceLogicalBlockSizeInner(fd uintptr) (int64, error) {
var bs int64
_, _, serr := unix.Syscall(unix.SYS_IOCTL, fd, unix.BLKSSZGET, uintptr(unsafe.Pointer(&bs)))
_, _, serr := unix.Syscall(unix.SYS_IOCTL, fd, unix.BLKSSZGET, uintptr(unsafe.Pointer(&bs))) // #nosec G103 It's safe.
if serr != 0 {
return 0, errors.Wrap(serr, "syscall get logical block size")
}
return int64(bs), nil
return bs, nil
}

View file

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// go:build windows
//go:build windows
package osspecifics