diff options
Diffstat (limited to 'src/tty.sh')
-rw-r--r-- | src/tty.sh | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -60,6 +60,7 @@ exit 0 #include <sys/types.h> #include <signal.h> #include <fcntl.h> +#include <sys/stat.h> #ifndef sgi # include <sys/file.h> #endif @@ -1499,6 +1500,19 @@ int ibaud, obaud; return 0; } + +int +CheckTtyname (tty) +char *tty; +{ + struct stat st; + + if (lstat(tty, &st) || !S_ISCHR(st.st_mode) || + (st.st_nlink > 1 && strncmp(tty, "/dev/", 5))) + return -1; + return 0; +} + /* * Write out the mode struct in a readable form */ |