Merge release-20191104.0-46-g76039f8 (automated)
This commit is contained in:
commit
be58d8f293
|
@ -17,7 +17,6 @@ package p9
|
|||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"runtime"
|
||||
"sync/atomic"
|
||||
"syscall"
|
||||
|
||||
|
@ -45,15 +44,10 @@ func (c *Client) Attach(name string) (File, error) {
|
|||
|
||||
// newFile returns a new client file.
|
||||
func (c *Client) newFile(fid FID) *clientFile {
|
||||
cf := &clientFile{
|
||||
return &clientFile{
|
||||
client: c,
|
||||
fid: fid,
|
||||
}
|
||||
|
||||
// Make sure the file is closed.
|
||||
runtime.SetFinalizer(cf, (*clientFile).Close)
|
||||
|
||||
return cf
|
||||
}
|
||||
|
||||
// clientFile is provided to clients.
|
||||
|
@ -192,7 +186,6 @@ func (c *clientFile) Remove() error {
|
|||
if !atomic.CompareAndSwapUint32(&c.closed, 0, 1) {
|
||||
return syscall.EBADF
|
||||
}
|
||||
runtime.SetFinalizer(c, nil)
|
||||
|
||||
// Send the remove message.
|
||||
if err := c.client.sendRecv(&Tremove{FID: c.fid}, &Rremove{}); err != nil {
|
||||
|
@ -214,7 +207,6 @@ func (c *clientFile) Close() error {
|
|||
if !atomic.CompareAndSwapUint32(&c.closed, 0, 1) {
|
||||
return syscall.EBADF
|
||||
}
|
||||
runtime.SetFinalizer(c, nil)
|
||||
|
||||
// Send the close message.
|
||||
if err := c.client.sendRecv(&Tclunk{FID: c.fid}, &Rclunk{}); err != nil {
|
||||
|
|
Loading…
Reference in New Issue