Skip to content

Commit

Permalink
xdg-document-portal: implement flock
Browse files Browse the repository at this point in the history
This is needed for Steam client

Signed-off-by: Kyohei KADOTA <[email protected]>
  • Loading branch information
lufia committed Apr 29, 2024
1 parent 0cad9ea commit d05f451
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion document-portal/document-portal-fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#ifdef HAVE_SYS_EXTATTR_H
#include <sys/extattr.h>
#endif
#include <sys/file.h>
#include <sys/time.h>
#include <sys/resource.h>

Expand Down Expand Up @@ -3192,10 +3193,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
Expand Down

0 comments on commit d05f451

Please sign in to comment.