Changeset c207a54267f04ddc789cd4197932711153e43d9b

Show
Ignore:
Timestamp:
03/30/09 00:29:47 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1238372987 +0000
git-parent:

[17a8e8e4556d3b18451fd9531ef964be402a98d0]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1238372987 +0000
Message:

fix the console line

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_console.c

    r6210da7 rc207a54  
    490490 
    491491void 
    492 noit_console_init() { 
     492noit_console_init(const char *progname) { 
     493  if(progname) { 
     494    char buff[32]; 
     495    snprintf(buff, sizeof(buff), "%s# ", progname); 
     496    noit_console_set_default_prompt(buff); 
     497  } 
    493498  el_multi_init(); 
    494499  signal(SIGTTOU, SIG_IGN); 
  • src/noit_console.h

    r56c7e9d rc207a54  
    106106} * noit_console_closure_t; 
    107107 
    108 API_EXPORT(void) noit_console_init(); 
     108API_EXPORT(void) noit_console_init(const char *); 
     109 
     110API_EXPORT(void) noit_console_set_default_prompt(const char *); 
    109111 
    110112API_EXPORT(int) 
  • src/noit_console_state.c

    r56c7e9d rc207a54  
    5454} 
    5555 
     56static char *default_prompt = NULL; 
     57 
     58void 
     59noit_console_set_default_prompt(const char *prompt) { 
     60  char *tofree = default_prompt; 
     61  default_prompt = strdup(prompt); 
     62  if(tofree) free(tofree); 
     63} 
    5664static char * 
    5765noit_console_state_prompt(EditLine *el) { 
    5866  static char *tl = "noit# "; 
     67  if(default_prompt) return default_prompt; 
    5968  return tl; 
    6069} 
  • src/noitd.c

    r6210da7 rc207a54  
    204204 
    205205  /* Initialize all of our listeners */ 
    206   noit_console_init(); 
     206  noit_console_init(APPNAME); 
    207207  noit_jlog_listener_init(); 
    208208  noit_livestream_listener_init(); 
  • src/stratcond.c

    r6210da7 rc207a54  
    142142    exit(-1); 
    143143  } 
    144   noit_console_init(); 
     144  noit_console_init(APPNAME); 
    145145  stratcon_realtime_http_init(APPNAME); 
    146146  noit_listener_init(APPNAME);