git://git.jankratochvil.net
/
udpgate.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Always report only once per the session: Error writing PID ...
[udpgate.git]
/
src
/
network.c
diff --git
a/src/network.c
b/src/network.c
index
4e70245
..
59d3a9a
100644
(file)
--- a/
src/network.c
+++ b/
src/network.c
@@
-118,7
+118,12
@@
FILE *f;
return TRUE;
}
if (!(f=fopen(NETWORK_PATHNAME_PID,"w"))) {
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 */
return FALSE;
}
fprintf(f,"%d\n",(int)pid); /* errors ignored */