Skip to content

Commit

Permalink
Cleanup comment, revert change to OpenFile
Browse files Browse the repository at this point in the history
  • Loading branch information
jfantinhardesty committed Nov 18, 2024
1 parent 6131e3a commit 4f19e6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions component/file_cache/file_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ func (fc *FileCache) downloadFile(handle *handlemap.Handle) error {
}

// Open the file in write mode.
f, err = common.OpenFile(localPath, flags, fMode)
f, err = common.OpenFile(localPath, os.O_CREATE|os.O_RDWR, fMode)
if err != nil {
log.Err("FileCache::downloadFile : error creating new file %s [%s]", handle.Path, err.Error())
return err
Expand Down Expand Up @@ -965,10 +965,12 @@ func (fc *FileCache) OpenFile(options internal.OpenFileOptions) (*handlemap.Hand
// create handle and record openFileOptions for later
handle := handlemap.NewHandle(options.Name)
handle.SetValue("openFileOptions", openFileOptions{flags: options.Flags, fMode: options.Mode})
// Increment the handle count in this lock item as there is one handle open for this now

if options.Flags&os.O_APPEND != 0 {
handle.Flags.Set(handlemap.HandleOpenedAppend)
}

// Increment the handle count in this lock item as there is one handle open for this now
flock.Inc()

return handle, nil
Expand Down

0 comments on commit 4f19e6a

Please sign in to comment.