summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2017-01-17 14:39:24 +0100
committerOndrej Holy <oholy@redhat.com>2017-01-17 15:37:05 +0100
commit7fab380504c1dcd65f04faeadde117395dd475c1 (patch)
tree94b6ba7305787ea237f22dc41e56f819b058585c /client
parenta6778d52aacc8acef6a2d007cef1d24665185f24 (diff)
downloadgvfs-7fab380504c1dcd65f04faeadde117395dd475c1.tar.gz
fuse: Print open flags in readable form
Debug prints contain open flags as an octal numbers, which is hard to read. Print selected flags in readable form for easier debugging.
Diffstat (limited to 'client')
-rw-r--r--client/gvfsfusedaemon.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index 95432953..4b1351dc 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -1054,7 +1054,12 @@ open_common (const gchar *path, struct fuse_file_info *fi, GFile *file, int outp
SET_FILE_HANDLE (fi, fh);
- g_debug ("open_common: flags=%o\n", fi->flags);
+ g_debug ("open_common: flags=%o (%s%s%s%s)\n",
+ fi->flags,
+ fi->flags & O_WRONLY ? "O_WRONLY " : "O_RDONLY ",
+ fi->flags & O_RDWR ? "O_RDWR " : "",
+ fi->flags & O_APPEND ? "O_APPEND " : "",
+ fi->flags & O_TRUNC ? "O_TRUNC " : "");
/* Set up a stream here, so we can check for errors */
set_pid_for_file (file);
@@ -1476,7 +1481,12 @@ vfs_write (const gchar *path, const gchar *buf, size_t len, off_t offset,
gint result = 0;
g_debug ("vfs_write: %s\n", path);
- g_debug ("vfs_write: flags=%o\n", fi->flags);
+ g_debug ("vfs_write: flags=%o (%s%s%s%s)\n",
+ fi->flags,
+ fi->flags & O_WRONLY ? "O_WRONLY " : "O_RDONLY ",
+ fi->flags & O_RDWR ? "O_RDWR " : "",
+ fi->flags & O_APPEND ? "O_APPEND " : "",
+ fi->flags & O_TRUNC ? "O_TRUNC " : "");
if ((file = file_from_full_path (path)))
{