From 44ccc71338f83b8b106780f9034c1406fd6ec2dd Mon Sep 17 00:00:00 2001 From: lufia Date: Mon, 29 Apr 2024 14:46:20 +0900 Subject: [PATCH] xdg-document-portal: implement flock This is needed for Steam client Signed-off-by: Kyohei KADOTA --- document-portal/document-portal-fuse.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/document-portal/document-portal-fuse.c b/document-portal/document-portal-fuse.c index ac2014a10..202bd25a5 100644 --- a/document-portal/document-portal-fuse.c +++ b/document-portal/document-portal-fuse.c @@ -3192,10 +3192,16 @@ xdp_fuse_flock (fuse_req_t req, int lock_op) { const char *op = "FLOCK"; + XdpFile *file = (XdpFile *)fi->fh; + int res; g_debug ("FLOCK %lx", ino); - xdp_reply_err (op, req, ENOSYS); + res = flock (file->fd, lock_op); + if (res == 0) + xdp_reply_ok (op, req); + else + xdp_reply_err (op, req, errno); } static void