Skip to contentSkip to conversation

tools/kvm/9p: WSTAT don't use open fid

PATCH New Aneesh Kumar K.V 1 participant 1 message Jul 10, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/kvm/9p: WSTAT don't use open fid

We should use full path instead of fd. WSTAT can operate on unopen fid.

---
 tools/kvm/virtio/9p.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/kvm/virtio/9p.c +1 -1
index 7e90024..a2fe5ca 100644
@@ -506,7 +506,7 @@ static void virtio_p9_wstat(struct p9_dev *p9dev,
 	fid = &p9dev->fids[fid_val];
 
 	if (wstat.length != -1UL) {
-		res = ftruncate(fid->fd, wstat.length);
+		res = truncate(fid->abs_path, wstat.length);
 		if (res < 0)
 			goto err_out;
 	}
Signature · 1 line
1.7.4.1