mirror of
https://github.com/minio/minio.git
synced 2025-01-24 05:03:16 -05:00
Log an error when calculating the binary checksum failed (#20454)
This commit is contained in:
parent
48a591e9b4
commit
e1c2344591
@ -184,10 +184,13 @@ var binaryChecksum = getBinaryChecksum()
|
|||||||
func getBinaryChecksum() string {
|
func getBinaryChecksum() string {
|
||||||
mw := md5.New()
|
mw := md5.New()
|
||||||
b, err := os.Open(os.Args[0])
|
b, err := os.Open(os.Args[0])
|
||||||
if err == nil {
|
if err != nil {
|
||||||
defer b.Close()
|
logger.Error("Calculating checksum failed: %s", err)
|
||||||
io.Copy(mw, b)
|
return "00000000000000000000000000000000"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer b.Close()
|
||||||
|
io.Copy(mw, b)
|
||||||
return hex.EncodeToString(mw.Sum(nil))
|
return hex.EncodeToString(mw.Sum(nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user