From 21fb7b225922b530538ca06ef3578c1e00cee9d2 Mon Sep 17 00:00:00 2001 From: short <> Date: Sun, 26 Jun 2005 01:56:37 +0000 Subject: [PATCH] Always report only once per the session: Error writing PID ... --- src/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/network.c b/src/network.c index 4e70245..59d3a9a 100644 --- a/src/network.c +++ b/src/network.c @@ -118,7 +118,12 @@ FILE *f; return TRUE; } if (!(f=fopen(NETWORK_PATHNAME_PID,"w"))) { - g_warning(_("Error writing PID %d to \"%s\": %m"),(int)pid,NETWORK_PATHNAME_PID); +static gboolean once=TRUE; + + if (once) { + once=FALSE; + g_warning(_("Error writing PID %d to \"%s\": %m"),(int)pid,NETWORK_PATHNAME_PID); + } return FALSE; } fprintf(f,"%d\n",(int)pid); /* errors ignored */ -- 1.8.3.1