Evil int stat!
This commit is contained in:
parent
7af240ce98
commit
1ea5901e90
2 changed files with 7 additions and 7 deletions
12
src/main.c
12
src/main.c
|
@ -44,9 +44,9 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
if(!sset) usage(argv[0]);
|
||||
setser(argv[0]);
|
||||
initscr();
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
initscr();
|
||||
cbreak();
|
||||
start_color();
|
||||
keypad(stdscr, TRUE);
|
||||
|
@ -94,11 +94,11 @@ void setser(char* ourname)
|
|||
tr.c_cflag &= ~CSIZE;
|
||||
tr.c_cflag |= CS7;
|
||||
tcsetattr(fd, TCSANOW, &tr);
|
||||
ioctl(fd, TIOCMGET, &stat);
|
||||
stat &= ~TIOCM_RTS;
|
||||
ioctl(fd, TIOCMSET, &stat);
|
||||
ioctl(fd, TIOCMGET, &stat);
|
||||
if(stat & TIOCM_RTS) {
|
||||
ioctl(fd, TIOCMGET, &status);
|
||||
status &= ~TIOCM_RTS;
|
||||
ioctl(fd, TIOCMSET, &status);
|
||||
ioctl(fd, TIOCMGET, &status);
|
||||
if(status & TIOCM_RTS) {
|
||||
fprintf(stderr, "RTS Not asserted! Aborting.\n");
|
||||
close(fd);
|
||||
exit(1);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <time.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/ioctl.h>
|
||||
int fd, siz, stat, logging;
|
||||
int fd, siz, status, logging;
|
||||
FILE* logfil;
|
||||
struct tm tim;
|
||||
sig_t* than(int s);
|
||||
|
|
Loading…
Reference in a new issue