mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Support linux with devfs
This commit is contained in:
parent
40c1c50201
commit
ce6e42f45a
@ -1,3 +1,7 @@
|
||||
2000-06-16 Pavel Machek <pavel@artax.karlin.mff.cuni.cz>
|
||||
|
||||
* cons_saver: support linux with devfs, patch by pavenis@lanet.lv
|
||||
|
||||
2000-06-14 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* panel.h, util.[ch] (struct WPanel, size_trunc, size_trunc_sep): size
|
||||
|
@ -161,17 +161,16 @@ char *detect_console (void)
|
||||
int xlen;
|
||||
|
||||
/* Must be console */
|
||||
/* Handle the case for /dev/tty?? */
|
||||
if (tty_name[len-5] == 't')
|
||||
/* Handle the case for /dev/tty?? and /dev/vc/?? */
|
||||
if (tty_name[len-5] == 't' || tty_name[len-5] == 'v')
|
||||
xlen = len - 1;
|
||||
else
|
||||
xlen = len;
|
||||
|
||||
/* General: /dev/ttyn */
|
||||
/* General: /dev/ttyn and /dev/vc/n */
|
||||
if (tty_name[xlen - 5] != '/' ||
|
||||
tty_name[xlen - 4] != 't' ||
|
||||
tty_name[xlen - 3] != 't' ||
|
||||
tty_name[xlen - 2] != 'y' ||
|
||||
! (strncmp(tty_name+xlen-4,"tty",3) == 0 ||
|
||||
strncmp(tty_name+xlen-4,"vc/",3) == 0) ||
|
||||
!isdigit(tty_name[xlen - 1]) ||
|
||||
!isdigit(tty_name[len - 1]))
|
||||
return "Doesn't look like console";
|
||||
|
Loading…
Reference in New Issue
Block a user