Updated LCDd server:

* Fixed bug that caused -c <config> option to fail
* Added -a <addr> option: address to bind to
* Added -p <port> option: port to listen on
This commit is contained in:
ddouthitt
2001-09-28 13:03:12 +00:00
parent bf5daf36ad
commit afd1f03c0b
+11 -4
View File
@@ -147,7 +147,7 @@ main (int argc, char **argv)
i = 0; i = 0;
// analyze options here.. // analyze options here..
while ((c = getopt(argc, argv, "d:hfiw:c:")) > 0) { while ((c = getopt(argc, argv, "a:p:d:hfiw:c:")) > 0) {
switch(c) { switch(c) {
case 'd': case 'd':
// Add to a list of drivers to be initialized later... // Add to a list of drivers to be initialized later...
@@ -158,6 +158,12 @@ main (int argc, char **argv)
} else } else
fprintf(stderr, "too many drivers!"); fprintf(stderr, "too many drivers!");
break; break;
case 'p':
lcd_port = atoi(optarg);
break;
case 'a':
strncpy(bind_addr, optarg, sizeof(bind_addr));
break;
case 'h': case 'h':
HelpScreen (); HelpScreen ();
break; break;
@@ -165,7 +171,7 @@ main (int argc, char **argv)
daemon_mode = 0; daemon_mode = 0;
break; break;
case 'c': case 'c':
strncmp(cfgfile, optarg, sizeof(cfgfile)); strncpy(cfgfile, optarg, sizeof(cfgfile));
break; break;
case 'i': case 'i':
disable_server_screen = 1; disable_server_screen = 1;
@@ -626,8 +632,9 @@ void
HelpScreen () HelpScreen ()
{ {
// This cleans up any messes on the display output if needed... // This cleans up any messes on the display output if needed...
if (lcd_ptr->framebuf != NULL) if (lcd_ptr)
lcd_ptr->close(); if (lcd_ptr->framebuf != NULL)
lcd_ptr->close();
printf ("\nLCDproc server daemon, %s\n", version); printf ("\nLCDproc server daemon, %s\n", version);
printf ("Copyright (c) 1999 Scott Scriven, William Ferrell, and misc contributors\n"); printf ("Copyright (c) 1999 Scott Scriven, William Ferrell, and misc contributors\n");