[gvfs] fuse: Add client pid in debug messages



commit 2eafe5fa8ef37e91c7c2caaf8620e18083545a3e
Author: Ondrej Holy <oholy redhat com>
Date:   Fri Jan 20 16:17:48 2017 +0100

    fuse: Add client pid in debug messages
    
    It is hard to debug what application is accessing fuse mount point.
    Let's add client pid in     the debug messages.

 client/gvfsfusedaemon.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index 6966490..80385b4 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -104,8 +104,12 @@ log_debug (const gchar   *log_domain,
            const gchar   *message,
            gpointer       unused_data)
 {
+  struct fuse_context *context;
+
+  context = fuse_get_context ();
+
   if (gvfs_get_debug ())
-    g_print ("fuse: %s", message);
+    g_print ("fuse(%u): %s", context ? context->pid : 0, message);
 }
 
 typedef struct {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]