|
|
@ -273,12 +273,12 @@ static pthread_t lthread;
|
|
|
|
static void *netconsole(void *vconsole)
|
|
|
|
static void *netconsole(void *vconsole)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct console *con = vconsole;
|
|
|
|
struct console *con = vconsole;
|
|
|
|
char hostname[256];
|
|
|
|
char hostname[MAXHOSTNAMELEN]="";
|
|
|
|
char tmp[512];
|
|
|
|
char tmp[512];
|
|
|
|
int res;
|
|
|
|
int res;
|
|
|
|
struct pollfd fds[2];
|
|
|
|
struct pollfd fds[2];
|
|
|
|
|
|
|
|
|
|
|
|
if (gethostname(hostname, sizeof(hostname)))
|
|
|
|
if (gethostname(hostname, sizeof(hostname)-1))
|
|
|
|
strncpy(hostname, "<Unknown>", sizeof(hostname)-1);
|
|
|
|
strncpy(hostname, "<Unknown>", sizeof(hostname)-1);
|
|
|
|
snprintf(tmp, sizeof(tmp), "%s/%d/%s\n", hostname, ast_mainpid, ASTERISK_VERSION);
|
|
|
|
snprintf(tmp, sizeof(tmp), "%s/%d/%s\n", hostname, ast_mainpid, ASTERISK_VERSION);
|
|
|
|
fdprint(con->fd, tmp);
|
|
|
|
fdprint(con->fd, tmp);
|
|
|
@ -1026,7 +1026,7 @@ static char *cli_prompt(EditLine *el)
|
|
|
|
memset(prompt, 0, sizeof(prompt));
|
|
|
|
memset(prompt, 0, sizeof(prompt));
|
|
|
|
while (*t != '\0' && *p < sizeof(prompt)) {
|
|
|
|
while (*t != '\0' && *p < sizeof(prompt)) {
|
|
|
|
if (*t == '%') {
|
|
|
|
if (*t == '%') {
|
|
|
|
char hostname[256];
|
|
|
|
char hostname[MAXHOSTNAMELEN]="";
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
struct timeval tv;
|
|
|
|
struct timeval tv;
|
|
|
|
struct tm tm;
|
|
|
|
struct tm tm;
|
|
|
@ -1668,7 +1668,7 @@ int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int c;
|
|
|
|
int c;
|
|
|
|
char filename[80] = "";
|
|
|
|
char filename[80] = "";
|
|
|
|
char hostname[256];
|
|
|
|
char hostname[MAXHOSTNAMELEN]="";
|
|
|
|
char tmp[80];
|
|
|
|
char tmp[80];
|
|
|
|
char * xarg = NULL;
|
|
|
|
char * xarg = NULL;
|
|
|
|
int x;
|
|
|
|
int x;
|
|
|
@ -1693,7 +1693,7 @@ int main(int argc, char *argv[])
|
|
|
|
option_remote++;
|
|
|
|
option_remote++;
|
|
|
|
option_nofork++;
|
|
|
|
option_nofork++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (gethostname(hostname, sizeof(hostname)))
|
|
|
|
if (gethostname(hostname, sizeof(hostname)-1))
|
|
|
|
strncpy(hostname, "<Unknown>", sizeof(hostname)-1);
|
|
|
|
strncpy(hostname, "<Unknown>", sizeof(hostname)-1);
|
|
|
|
ast_mainpid = getpid();
|
|
|
|
ast_mainpid = getpid();
|
|
|
|
ast_ulaw_init();
|
|
|
|
ast_ulaw_init();
|
|
|
|