From: short <> Date: Sun, 26 Jun 2005 01:56:37 +0000 (+0000) Subject: Always report only once per the session: Error writing PID ... X-Git-Tag: udpgate-1_0_2~28 X-Git-Url: https://git.jankratochvil.net/?p=udpgate.git;a=commitdiff_plain;h=21fb7b225922b530538ca06ef3578c1e00cee9d2 Always report only once per the session: Error writing PID ... --- 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 */