Skip to content
This repository was archived by the owner on Mar 11, 2020. It is now read-only.

Commit e571b90

Browse files
titanousprogrium
authored andcommitted
ufs: Allow fid to be 0
0 is a valid fid, so check against the NOFID value instead. Signed-off-by: Jonathan Rudenberg <[email protected]>
1 parent 84f0f75 commit e571b90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: ufs/session.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (sess *session) getRef(fid p9p.Fid) (*FileRef, error) {
3131
sess.Lock()
3232
defer sess.Unlock()
3333

34-
if fid == 0 {
34+
if fid == p9p.NOFID {
3535
return nil, p9p.ErrUnknownfid
3636
}
3737

@@ -51,7 +51,7 @@ func (sess *session) newRef(fid p9p.Fid, path string) (*FileRef, error) {
5151
sess.Lock()
5252
defer sess.Unlock()
5353

54-
if fid == 0 {
54+
if fid == p9p.NOFID {
5555
return nil, p9p.ErrUnknownfid
5656
}
5757

0 commit comments

Comments
 (0)