It's 1994 --- remove stdout redirection check.
This commit is contained in:
parent
17ea2355b4
commit
4f4897ff25
|
@ -39,7 +39,7 @@ char copyright[] =
|
|||
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "from: @(#)stty.c 5.28 (Berkeley) 6/5/91";*/
|
||||
static char rcsid[] = "$Id: stty.c,v 1.7 1993/08/01 18:57:36 mycroft Exp $";
|
||||
static char rcsid[] = "$Id: stty.c,v 1.8 1994/01/18 18:10:56 jtc Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -99,8 +99,6 @@ args: argc -= optind;
|
|||
if (ioctl(i.fd, TIOCGWINSZ, &i.win) < 0)
|
||||
warn("TIOCGWINSZ: %s\n", strerror(errno));
|
||||
|
||||
checkredirect(); /* conversion aid */
|
||||
|
||||
switch(fmt) {
|
||||
case NOTSET:
|
||||
if (*argv)
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "from: @(#)util.c 5.2 (Berkeley) 6/4/91";*/
|
||||
static char rcsid[] = "$Id: util.c,v 1.5 1993/08/01 18:57:34 mycroft Exp $";
|
||||
static char rcsid[] = "$Id: util.c,v 1.6 1994/01/18 18:10:58 jtc Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -44,23 +44,6 @@ static char rcsid[] = "$Id: util.c,v 1.5 1993/08/01 18:57:34 mycroft Exp $";
|
|||
#include "stty.h"
|
||||
#include "extern.h"
|
||||
|
||||
/*
|
||||
* Gross, but since we're changing the control descriptor from 1 to 0, most
|
||||
* users will be probably be doing "stty > /dev/sometty" by accident. If 1
|
||||
* and 2 are both ttys, but not the same, assume that 1 was incorrectly
|
||||
* redirected.
|
||||
*/
|
||||
void
|
||||
checkredirect()
|
||||
{
|
||||
struct stat sb1, sb2;
|
||||
|
||||
if (isatty(STDOUT_FILENO) && isatty(STDERR_FILENO) &&
|
||||
!fstat(STDOUT_FILENO, &sb1) && !fstat(STDERR_FILENO, &sb2) &&
|
||||
(sb1.st_rdev != sb2.st_rdev))
|
||||
warn("stdout appears redirected, but stdin is the control descriptor");
|
||||
}
|
||||
|
||||
#if __STDC__
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue