]> Sergey Matveev's repositories - dht-bootstrap.git/blobdiff - dht-bootstrap.c
Stats in process title
[dht-bootstrap.git] / dht-bootstrap.c
index e8c0b2c7bd87dc7bc40359e4f8223af248cf006c..07ac332d8d5befe169585494109d81dfb7ff221d 100644 (file)
@@ -37,6 +37,12 @@ THE SOFTWARE.
 
 #define MIN(x, y) ((x) <= (y) ? (x) : (y))
 
+#ifdef __linux__
+// clang-format off
+void setproctitle_fast(const char *_fmt, ...) {}
+// clang-format on
+#endif
+
 static int
 send_ping(struct sockaddr *sa, int salen, const unsigned char *tid, int tid_len);
 static int
@@ -507,13 +513,12 @@ main(int argc, char **argv)
             tv_sec = random() % 30;
         int tv_msec = random() % 1000;
 
-        if (dht_debug)
-            debugf(
-                "%d+%d %d+%d\n",
-                list_elements(&v4_confirmed),
-                list_elements(&v6_confirmed),
-                list_elements(&v4_new),
-                list_elements(&v6_new));
+        setproctitle_fast(
+            "%d+%d %d+%d",
+            list_elements(&v4_confirmed),
+            list_elements(&v6_confirmed),
+            list_elements(&v4_new),
+            list_elements(&v6_new));
 
         rc = poll(fds, 2, tv_sec * 1000 + tv_msec);
         if (rc < 0) {