rc: use /dev/tty as a tty (not only /dev/cons)
This commit is contained in:
parent
001069aa7b
commit
464eee3ed8
|
@ -555,6 +555,7 @@ int
|
||||||
Isatty(int fd)
|
Isatty(int fd)
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
int l;
|
||||||
|
|
||||||
if(fd2path(fd, buf, sizeof buf) != 0)
|
if(fd2path(fd, buf, sizeof buf) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -563,8 +564,12 @@ Isatty(int fd)
|
||||||
if(strcmp(buf, "#c/cons") == 0)
|
if(strcmp(buf, "#c/cons") == 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* might be /mnt/term/dev/cons */
|
/* might be /mnt/term/dev/cons or a virtual tty */
|
||||||
return strlen(buf) >= 9 && strcmp(buf+strlen(buf)-9, "/dev/cons") == 0;
|
l = strlen(buf);
|
||||||
|
if((l >= 9 && strcmp(buf+l-9, "/dev/cons") == 0)
|
||||||
|
||(l >= 8 && strcmp(buf+l-8, "/dev/tty") == 0))
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue