Skip to content

Commit

Permalink
Do not swallow errors silently
Browse files Browse the repository at this point in the history
Even if it is a minor error. Instead print it with 'debug' verbosity
level.
  • Loading branch information
anatol committed Dec 22, 2021
1 parent b046857 commit 8aaffdd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions init/blkinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func probeGpt(f *os.File) *blkInfo {

lbaSize, err := unix.IoctlGetInt(int(f.Fd()), unix.BLKSSZGET)
if err != nil {
debug("unable to get sector size for %s: %v", f.Name(), err)
lbaSize = defaultSectorSize
}
tableHeaderOffset := tableHeaderOffsetSector * int64(lbaSize)
Expand Down

0 comments on commit 8aaffdd

Please sign in to comment.