summaryrefslogtreecommitdiff
path: root/asterisk.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-01-12 05:05:35 +0000
committerMark Spencer <markster@digium.com>2004-01-12 05:05:35 +0000
commitee342cc3b80db292625e41019a3afd8bb4cdc568 (patch)
tree02f9ec032bd53fec6e9b9004db327ad9991cf73a /asterisk.c
parent5520872def04f3fe7cc61f23edf4b9c87007a02d (diff)
Add ww's improved syslog support (bug #587)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'asterisk.c')
-rwxr-xr-xasterisk.c31
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;