Commit 5951e85e authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Generate less garbage for notify.

parent f47438ec
......@@ -459,7 +459,9 @@ func (ms *MountState) writeEntryNotify(parent uint64, name string) Status {
// Many versions of FUSE generate stacktraces if the
// terminating null byte is missing.
nameBytes := []byte(name + "\000")
nameBytes := make([]byte, len(name)+1)
copy(nameBytes, name)
nameBytes[len(nameBytes)-1] = '\000'
req.outData = unsafe.Pointer(entry)
req.flatData.Data = nameBytes
result := ms.write(&req)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment