Some while ago I got some problems with stty, so I wanted to test this
using checkpc with the T option. It turns up that the serial line you
specify on the command line was never used. See the patch for details.
Also, I changed the the stty command so it assumes to work on stdin and
report on stdout, except on old BSD and SunOS systems. Can anyone name
some systems with a stty command which works on stdout and reports on stderr
other than the old BSD systems, and are these systems still in active use?
I myself have never seen a stty command wich didn't work on stdin, that is,
several SVR2 and SVR3 derivatives including SCO xenix and unix.
Villy
diff -ru LPRng-3.8.12.original/src/common/checkpc.c LPRng-3.8.12/src/common/checkpc.c
--- LPRng-3.8.12.original/src/common/checkpc.c Mon May 6 18:03:44 2002
+++ LPRng-3.8.12/src/common/checkpc.c Mon Jun 10 08:37:26 2002
@@ -50,7 +50,7 @@
char *path; /* end of string */
int ruid, euid, rgid, egid;
char *printcap;
- char *serial_line = 0;
+ /*char *serial_line = 0;*/
struct line_list raw, spooldirs;
char *s, *t;
struct stat statb;
@@ -113,7 +113,7 @@
case 'P': User_specified_printer = Optarg; break;
case 'T':
initsetproctitle( argc, argv, envp );
- Test_port( getuid(), geteuid(), serial_line );
+ Test_port( getuid(), geteuid(), Optarg );
exit(0);
break;
}
@@ -961,7 +961,7 @@
static int fd;
static int i, err;
struct stat statb;
- char *Stty_command;
+ /*char *Stty_command;*/
status = 0;
fd = -1;
@@ -1195,6 +1195,9 @@
sttycmd = "stty -a >%s"; /* on STDOUT */
#elif defined(BSD) /* old style BSD4.[23] */
sttycmd = "stty everything 2>%s";
+#else /* That is: All other System V derivatives and AIX as well */
+ ttyfd = 0; /* STDIN is reported */
+ sttycmd = "/bin/stty -a >%s"; /* on STDOUT */
#endif
if( fd != ttyfd ){
i = dup2(fd, ttyfd );
@@ -1212,8 +1215,8 @@
cmd, fd, ttyfd );
i = system( cmd );
FPRINTF( STDERR, "\n\n" );
- Stty_command = "9600 -even odd echo";
- FPRINTF( STDERR, "Trying 'stty %s'\n", Stty_command );
+ Stty_command_DYN = "9600 -even odd echo";
+ FPRINTF( STDERR, "Trying 'stty %s'\n", Stty_command_DYN );
Do_stty( ttyfd );
SNPRINTF( stty, sizeof(stty)) sttycmd, t2 );
SNPRINTF( cmd, sizeof(cmd))
@@ -1221,14 +1224,14 @@
FPRINTF( STDERR, "Doing '%s'\n", cmd );
i = system( cmd );
FPRINTF( STDERR, "\n\n" );
- Stty_command = "1200 -odd even";
- FPRINTF( STDERR, "Trying 'stty %s'\n", Stty_command );
+ Stty_command_DYN = "1200 -odd even";
+ FPRINTF( STDERR, "Trying 'stty %s'\n", Stty_command_DYN );
Do_stty( ttyfd );
FPRINTF( STDERR, "Doing '%s'\n", cmd );
i = system( cmd );
FPRINTF( STDERR, "\n\n" );
- Stty_command = "300 -even -odd -echo cbreak";
- FPRINTF( STDERR, "Trying 'stty %s'\n", Stty_command );
+ Stty_command_DYN = "300 -even -odd -echo cbreak";
+ FPRINTF( STDERR, "Trying 'stty %s'\n", Stty_command_DYN );
Do_stty( ttyfd );
SNPRINTF( stty, sizeof(stty)) sttycmd, serial_line, t2 );
FPRINTF( STDERR, "Doing '%s'\n", cmd );
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------