qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtiofsd: fix compile error if 'F_OFD_GETLK' not defined
@ 2019-07-30  0:27 piaojun
  2019-07-30 12:22 ` Liam Merwick
  2019-07-30 13:28 ` Eric Blake
  0 siblings, 2 replies; 8+ messages in thread
From: piaojun @ 2019-07-30  0:27 UTC (permalink / raw)
  To: virtio-fs, qemu-devel; +Cc: piaojun

Use F_GETLK for fcntl when F_OFD_GETLK not defined.

Signed-off-by: Jun Piao <piaojun@huawei.com>
---
 contrib/virtiofsd/passthrough_ll.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/contrib/virtiofsd/passthrough_ll.c b/contrib/virtiofsd/passthrough_ll.c
index 9ae1381..757785b 100644
--- a/contrib/virtiofsd/passthrough_ll.c
+++ b/contrib/virtiofsd/passthrough_ll.c
@@ -1619,7 +1619,11 @@ static void lo_getlk(fuse_req_t req, fuse_ino_t ino,
 		return;
 	}

+#ifdef F_OFD_GETLK
 	ret = fcntl(plock->fd, F_OFD_GETLK, lock);
+#else
+	ret = fcntl(plock->fd, F_GETLK, lock);
+#endif
 	if (ret == -1)
 		saverr = errno;
 	pthread_mutex_unlock(&inode->plock_mutex);
@@ -1668,7 +1672,12 @@ static void lo_setlk(fuse_req_t req, fuse_ino_t ino,

 	/* TODO: Is it alright to modify flock? */
 	lock->l_pid = 0;
+
+#ifdef F_OFD_GETLK
 	ret = fcntl(plock->fd, F_OFD_SETLK, lock);
+#else
+	ret = fcntl(plock->fd, F_SETLK, lock);
+#endif
 	if (ret == -1) {
 		saverr = errno;
 	}
-- 


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-08-02  8:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-30  0:27 [Qemu-devel] [PATCH] virtiofsd: fix compile error if 'F_OFD_GETLK' not defined piaojun
2019-07-30 12:22 ` Liam Merwick
2019-07-30 13:08   ` piaojun
2019-07-30 13:28 ` Eric Blake
2019-07-30 14:00   ` piaojun
2019-08-01 14:20   ` [Qemu-devel] [Virtio-fs] " Dr. David Alan Gilbert
2019-08-01 14:26     ` Dr. David Alan Gilbert
2019-08-02  8:16       ` piaojun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).