mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Various cleanup
Renamed device -> tty_device. Removed hardcoded tty device name max length. Updated README.
This commit is contained in:
parent
9721f2436c
commit
cc7f21e735
4 changed files with 9 additions and 9 deletions
|
|
@ -26,6 +26,7 @@
|
|||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <fcntl.h>
|
||||
#include <termios.h>
|
||||
#include <stdbool.h>
|
||||
|
|
@ -34,8 +35,6 @@
|
|||
#include "gotty/print.h"
|
||||
#include "gotty/options.h"
|
||||
|
||||
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
|
||||
|
||||
static int connected = false;
|
||||
struct termios new_stdout, old_stdout, old_tio;
|
||||
static int fd;
|
||||
|
|
@ -78,7 +77,7 @@ void wait_for_tty_device(void)
|
|||
/* Timeout */
|
||||
|
||||
/* Test for device file */
|
||||
if (stat(option.device, &status) == 0)
|
||||
if (stat(option.tty_device, &status) == 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -146,7 +145,7 @@ int connect_tty(void)
|
|||
char c_stdin[3];
|
||||
|
||||
/* Open tty device */
|
||||
fd = open(option.device, O_RDWR | O_NOCTTY );
|
||||
fd = open(option.tty_device, O_RDWR | O_NOCTTY );
|
||||
if (fd <0)
|
||||
{
|
||||
printf("\033[300DError: %s\n\033[300D", strerror(errno));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue