nasty hack to print posix locks
authorAndrew Tridgell <tridge@samba.org>
Fri, 5 May 2000 01:11:23 +0000 (01:11 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 5 May 2000 01:11:23 +0000 (01:11 +0000)
source/utils/locktest.c

index 3b2d2be13e8d4a226f2503fad90aab061abe41ae..7aa32325a44658b287d52c1e8ea7675aa47f2254 100644 (file)
@@ -42,6 +42,9 @@ static BOOL analyze;
 #define NFILES 2
 #define LOCK_TIMEOUT 0
 
+#define NASTY_POSIX_LOCK_HACK 1
+
+
 struct record {
        char r1, r2;
        char conn, f;
@@ -74,6 +77,20 @@ static void print_brl(SMB_DEV_T dev, SMB_INO_T ino, int pid,
               (int)pid, (int)dev, (int)ino, 
               lock_type==READ_LOCK?"R":"W",
               (double)start, (double)size);
+
+#if NASTY_POSIX_LOCK_HACK
+       {
+               pstring cmd;
+               static SMB_INO_T lastino;
+
+               if (lastino != ino) {
+                       slprintf(cmd, sizeof(cmd), 
+                                "egrep POSIX.*%d /proc/locks", (int)ino);
+                       system(cmd);
+               }
+               lastino = ino;
+       }
+#endif
 }
 
 /*****************************************************