X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/0fcfad0ee6d4510c8cbfb22e757e68a442b94b0b..62d0bbf62f5bd3c1da25ee2adf60d3b4efe24cc8:/client/uart.c diff --git a/client/uart.c b/client/uart.c index 71cea110..5870ebae 100644 --- a/client/uart.c +++ b/client/uart.c @@ -119,7 +119,12 @@ void uart_close(const serial_port sp) { fl.l_start = 0; fl.l_len = 0; fl.l_pid = getpid(); - fcntl(spu->fd, F_SETLK, &fl); + + // Does the system allows us to place a lock on this file descriptor + int err = fcntl(spu->fd, F_SETLK, &fl); + if ( err == -1) { + //perror("fcntl"); + } close(spu->fd); free(sp); } @@ -380,10 +385,10 @@ serial_port uart_open(const char* pcPortName) { return INVALID_SERIAL_PORT; } - sp->ct.ReadIntervalTimeout = 0; - sp->ct.ReadTotalTimeoutMultiplier = 0; + sp->ct.ReadIntervalTimeout = 1; + sp->ct.ReadTotalTimeoutMultiplier = 1; sp->ct.ReadTotalTimeoutConstant = 30; - sp->ct.WriteTotalTimeoutMultiplier = 0; + sp->ct.WriteTotalTimeoutMultiplier = 1; sp->ct.WriteTotalTimeoutConstant = 30; if(!SetCommTimeouts(sp->hPort,&sp->ct)) {