This commit is contained in:
iceman1001 committed 2026-07-03 11:33:35 +02:00
1 parent fc773ea230
commit 41ad752a95
2 files changed
+5 -3

No files matched your search

+4 -1
View File
@@ -58,7 +58,10 @@ int open_nb_socket(const char *addr, const char *port) {
// make non-blocking
if (sockfd != -1) {
fcntl(sockfd, F_SETFL, fcntl(sockfd, F_GETFL) | O_NONBLOCK);
if(fcntl(sockfd, F_SETFL, fcntl(sockfd, F_GETFL) | O_NONBLOCK) < 0) {
PrintAndLogEx(ERR, "fcntl failed in open_nb_socket");
return -1;
}
}
return sockfd;
+1 -2
View File
@@ -462,8 +462,7 @@ void uart_close(const serial_port sp) {
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) {
if (fcntl(spu->fd, F_SETLK, &fl) < 0) {
//silent error message as it can be called from uart_open failing modes, e.g. when waiting for port to appear
//PrintAndLogEx(ERR, "UART error while closing port");
}