mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
Start using new errors package (#8207)
This commit is contained in:
committed by
kannappanr
parent
e12f52e2c6
commit
a7be313230
@@ -19,7 +19,6 @@
|
||||
package lock
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
@@ -39,7 +38,11 @@ func lockedOpenFile(path string, flag int, perm os.FileMode, lockType int) (*Loc
|
||||
case syscall.O_RDWR | syscall.O_CREAT:
|
||||
lockType |= syscall.LOCK_EX
|
||||
default:
|
||||
return nil, fmt.Errorf("Unsupported flag (%d)", flag)
|
||||
return nil, &os.PathError{
|
||||
Op: "open",
|
||||
Path: path,
|
||||
Err: syscall.EINVAL,
|
||||
}
|
||||
}
|
||||
|
||||
f, err := os.OpenFile(path, flag|syscall.O_SYNC, perm)
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
package lock
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
@@ -39,7 +38,11 @@ func lockedOpenFile(path string, flag int, perm os.FileMode, rlockType int) (*Lo
|
||||
case syscall.O_RDWR | syscall.O_CREAT:
|
||||
lockType = syscall.F_WRLCK
|
||||
default:
|
||||
return nil, fmt.Errorf("Unsupported flag (%d)", flag)
|
||||
return nil, &os.PathError{
|
||||
Op: "open",
|
||||
Path: path,
|
||||
Err: syscall.EINVAL,
|
||||
}
|
||||
}
|
||||
|
||||
var lock = syscall.Flock_t{
|
||||
|
||||
Reference in New Issue
Block a user