This patch adds and documents a -quiet option to dtlogin, 
which prevents GettyMessage() from writing to the terminal.
Useful if you log in to the terminal while dtlogin is running or before
it starts.

Default behavior is unchanged. Compile and run tested.
It was written after the path change, 
so it will have some fuzz if applied first.

Thanks,
Isaac Dunham
commit 36ebe54f6eee481de6135bff1fdae40826660463
Author: Isaac Dunham <idun...@lavabit.com>
Date:   Sat Sep 21 20:30:52 2013 -0700

    Add -quiet option to dtlogin.
    
    This should shut up the console spamming, for those who use VT1.
    Default behavior is not changed.

diff --git a/cde/doc/C/guides/man/man1_dt/login.sgm b/cde/doc/C/guides/man/man1_dt/login.sgm
index 3265240..fe6b257 100644
--- a/cde/doc/C/guides/man/man1_dt/login.sgm
+++ b/cde/doc/C/guides/man/man1_dt/login.sgm
@@ -13,7 +13,7 @@
 service </refpurpose></refnamediv>
 <refsynopsisdiv>
 <cmdsynopsis>
-<command>dtlogin</command><arg choice="opt">&minus;config<replaceable>configuration_file</replaceable></arg><arg choice="opt">&minus;daemon</arg><arg choice="opt">&minus;debug<replaceable>debug_level</replaceable></arg><arg choice="opt">&minus;error<replaceable>error_log_file</replaceable></arg><arg choice="opt">&minus;nodaemon</arg><arg choice="opt">&minus;resources<replaceable>resource_file</replaceable></arg>
+<command>dtlogin</command><arg choice="opt">&minus;config<replaceable>configuration_file</replaceable></arg><arg choice="opt">&minus;daemon</arg><arg choice="opt">&minus;debug<replaceable>debug_level</replaceable></arg><arg choice="opt">&minus;error<replaceable>error_log_file</replaceable></arg><arg choice="opt">&minus;quiet</arg><arg choice="opt">&minus;nodaemon</arg><arg choice="opt">&minus;resources<replaceable>resource_file</replaceable></arg>
 <arg choice="opt">&minus;server<replaceable>server_entry</replaceable></arg>
 <arg choice="opt">&minus;udpPort<replaceable>port_number</replaceable></arg>
 <arg choice="opt">&minus;session<replaceable>session_program</replaceable></arg>
@@ -360,6 +360,14 @@ resource.
 </para>
 </listitem>
 </varlistentry>
+<varlistentry><term>&minus;quiet</term>
+<listitem>
+<!-- ex-TP-->
+<para>Specifies True as the value for the <literal>quiet</literal>
+resource. This prevents dtlogin from writing status messages to tty1.
+</para>
+</listitem>
+</varlistentry>
 <varlistentry><term>&minus;resources resource_file</term>
 <listitem>
 <!-- ex-TP-->
diff --git a/cde/programs/dtlogin/dm.c b/cde/programs/dtlogin/dm.c
index 59b99cf..18f5bd5 100644
--- a/cde/programs/dtlogin/dm.c
+++ b/cde/programs/dtlogin/dm.c
@@ -1617,6 +1617,8 @@ GettyMessage( struct display *d, int msgnum )
     FILE *tf;
     char buf[128];
 
+    if (quiet) return;
+
     strcpy(buf,"/dev/");
     strcat(buf,d->gettyLine);
     
diff --git a/cde/programs/dtlogin/dm.h b/cde/programs/dtlogin/dm.h
index 032a21d..0de7960 100644
--- a/cde/programs/dtlogin/dm.h
+++ b/cde/programs/dtlogin/dm.h
@@ -495,6 +495,7 @@ extern int	debugLevel;
 extern char	*errorLogFile;
 extern int	errorLogSize;
 extern int	daemonMode;
+extern int	quiet;
 extern char	*pidFile;
 extern int	lockPidFile;
 extern char	*authDir;
diff --git a/cde/programs/dtlogin/resource.c b/cde/programs/dtlogin/resource.c
index 6820cf4..2c4e62f 100644
--- a/cde/programs/dtlogin/resource.c
+++ b/cde/programs/dtlogin/resource.c
@@ -72,6 +72,7 @@ int	debugLevel;
 char	*errorLogFile;
 int	errorLogSize;
 int	daemonMode;
+int	quiet;
 char	*pidFile;
 int	lockPidFile;
 char	*authDir;
@@ -254,6 +255,8 @@ struct dmResources {
 				"50",
 "daemonMode",	"DaemonMode",	DM_BOOL,	(char **) &daemonMode,
 				"false",
+"quiet",	"quiet",	DM_BOOL,	(char **) &quiet,
+				"false",
 "pidFile",	"PidFile",	DM_STRING,	&pidFile,
 				"",
 "lockPidFile",	"LockPidFile",	DM_BOOL,	(char **) &lockPidFile,
@@ -499,7 +502,8 @@ XrmOptionDescRec optionTable [] = {
 {"-debug",	"*debugLevel",		XrmoptionSepArg,	(caddr_t) NULL },
 {"-xrm",	NULL,			XrmoptionResArg,	(caddr_t) NULL },
 {"-daemon",	".daemonMode",		XrmoptionNoArg,		"true"         },
-{"-nodaemon",	".daemonMode",		XrmoptionNoArg,		"false"        }
+{"-nodaemon",	".daemonMode",		XrmoptionNoArg,		"false"        },
+{"-quiet",	".quiet",		XrmoptionNoArg,		"true"        }
 };
 
 static int	originalArgc;
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to