mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
parent
88d719689c
commit
e1b0582859
@ -268,6 +268,7 @@ func fsOpenFile(ctx context.Context, readPath string, offset int64) (io.ReadClos
|
|||||||
// Stat to get the size of the file at path.
|
// Stat to get the size of the file at path.
|
||||||
st, err := fr.Stat()
|
st, err := fr.Stat()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
fr.Close()
|
||||||
err = osErrToFileErr(err)
|
err = osErrToFileErr(err)
|
||||||
if err != errFileNotFound {
|
if err != errFileNotFound {
|
||||||
logger.LogIf(ctx, err)
|
logger.LogIf(ctx, err)
|
||||||
@ -277,6 +278,7 @@ func fsOpenFile(ctx context.Context, readPath string, offset int64) (io.ReadClos
|
|||||||
|
|
||||||
// Verify if its not a regular file, since subsequent Seek is undefined.
|
// Verify if its not a regular file, since subsequent Seek is undefined.
|
||||||
if !st.Mode().IsRegular() {
|
if !st.Mode().IsRegular() {
|
||||||
|
fr.Close()
|
||||||
return nil, 0, errIsNotRegular
|
return nil, 0, errIsNotRegular
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,6 +286,7 @@ func fsOpenFile(ctx context.Context, readPath string, offset int64) (io.ReadClos
|
|||||||
if offset > 0 {
|
if offset > 0 {
|
||||||
_, err = fr.Seek(offset, io.SeekStart)
|
_, err = fr.Seek(offset, io.SeekStart)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
fr.Close()
|
||||||
logger.LogIf(ctx, err)
|
logger.LogIf(ctx, err)
|
||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user