Always report only once per the session: Error writing PID ...
authorshort <>
Sun, 26 Jun 2005 01:56:37 +0000 (01:56 +0000)
committershort <>
Sun, 26 Jun 2005 01:56:37 +0000 (01:56 +0000)
src/network.c

index 4e70245..59d3a9a 100644 (file)
@@ -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 */