fl.l_start = 0;
fl.l_len = 0;
fl.l_pid = getpid();
+
+ // 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);
}
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)) {