2
0
Fork 0

Handle errno in angel_fake_log

personal/stbuehler/wip
Stefan Bühler 2008-12-22 17:03:43 +01:00
parent 324224fe2e
commit bb59776ea3
2 changed files with 7 additions and 2 deletions

View File

@ -6,7 +6,7 @@
/* listen to a socket */
LI_API int angel_listen(server *srv, GString *str);
/* send log messages while startup to angel, frees the string */
/* send log messages during startup to angel, frees the string */
LI_API gboolean angel_log(server *srv, GString *str);

View File

@ -78,7 +78,7 @@ int angel_fake_listen(server *srv, GString *str) {
}
}
/* send log messages while startup to angel */
/* print log messages during startup to stderr */
gboolean angel_fake_log(server *srv, GString *str) {
const char *buf;
guint len;
@ -92,6 +92,11 @@ gboolean angel_fake_log(server *srv, GString *str) {
while (len > 0) {
written = write(2, buf, len);
if (written < 0) {
switch (errno) {
case EAGAIN:
case EINTR:
continue;
}
g_string_free(str, TRUE);
return FALSE;
}