[distcc] Patch?
Jean Delvare
khali at linux-fr.org
Sat Mar 19 13:40:44 GMT 2005
Hi all,
> > 1) Add a timestamp to every line from the distccmon-text output
> (...)
> Care to redo a patch implementing (1) only (since mine implements (2)
> more efficiently, or so I think), and addressing the points I listed
> above?
Here comes my own reimplementation of (1). It addresses all my own
objections to Eddie's patch. Credits go to him as I obviously based my
work on his.
Comments anyone?
Martin, would you accept such a patch?
Thanks,
--
Jean Delvare
-------------- next part --------------
--- distcc-2.18.3/src/mon-text.c.orig 2005-03-19 14:11:15.000000000 +0100
+++ distcc-2.18.3/src/mon-text.c 2005-03-19 14:26:42.000000000 +0100
@@ -28,6 +28,7 @@
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
+#include <time.h>
#include "types.h"
#include "distcc.h"
@@ -91,6 +92,17 @@
if ((ret = dcc_mon_poll(&list)))
return ret;
+ /* Print a timestamp only if something is actually happening */
+ if (list) {
+ time_t current_time;
+ char current_time_str[9];
+
+ time(¤t_time);
+ if (strftime(current_time_str, sizeof(current_time_str),
+ "%H:%M:%S", localtime(¤t_time)) == 8)
+ printf("[%s]\n", current_time_str);
+ }
+
for (i = list; i; i = i->next) {
#if 1
if (i->curr_phase == DCC_PHASE_DONE)
More information about the distcc
mailing list