vfs: decode flags in Open/OpenFile for debug

This commit is contained in:
Nick Craig-Wood
2017-11-14 21:00:08 +00:00
parent f5f8c0c438
commit e7f2935333
3 changed files with 39 additions and 2 deletions

View File

@@ -95,8 +95,7 @@ func (fh *RWFileHandle) openPending(truncate bool) (err error) {
if rdwrMode != os.O_RDONLY {
fh.file.addWriters(1)
}
fs.Debugf(fh.remote, "Opening cached copy with flags=0x%02X", fh.flags)
fs.Debugf(fh.remote, "Opening cached copy with flags=%s", decodeOpenFlags(fh.flags))
fd, err := os.OpenFile(fh.osPath, fh.flags|os.O_CREATE, 0600)
if err != nil {
return errors.Wrap(err, "cache open file failed")