diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-01-12 05:05:35 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-01-12 05:05:35 +0000 |
commit | 2f331c310e79ede902f38ea92b2077509b067b28 (patch) | |
tree | 02f9ec032bd53fec6e9b9004db327ad9991cf73a /asterisk.c | |
parent | a3c67a2026e4c04913cf8c4add1f5986e1adbd16 (diff) |
Add ww's improved syslog support (bug #587)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1973 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rwxr-xr-x | asterisk.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/asterisk.c b/asterisk.c index b4985e28c..6c45865ba 100755 --- a/asterisk.c +++ b/asterisk.c @@ -148,13 +148,34 @@ static int fdprint(int fd, const char *s) return write(fd, s, strlen(s) + 1); } +/* + * write the string to all attached console clients + */ +static void ast_network_puts(const char *string) +{ + int x; + for (x=0;x<AST_MAX_CONNECTS; x++) { + if (consoles[x].fd > -1) + fdprint(consoles[x].p[1], string); + } +} + + +/* + * write the string to the console, and all attached + * console clients + */ +void ast_console_puts(const char *string) +{ + fputs(string, stdout); + fflush(stdout); + ast_network_puts(string); +} + static void network_verboser(const char *s, int pos, int replace, int complete) + /* ARGUSED */ { - int x; - for (x=0;x<AST_MAX_CONNECTS; x++) { - if (consoles[x].fd > -1) - fdprint(consoles[x].p[1], s); - } + ast_network_puts(s); } static pthread_t lthread; |