Files
telephony/net/miax/patches/010-usleep.patch
Christian Marangi f6d8ae584f miax: add patch fixing compilation warning
Add 2 patch fixing compilation warning (now error) for implicit
declaration and incompatible pointer type.

Refresh all affected patch.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 02:06:26 +01:00

25 lines
704 B
Diff

--- a/modem.c
+++ b/modem.c
@@ -76,10 +76,11 @@ int tty_modem(char* send, char *receive)
int l=0, in=0, out=0, timeout=10;
char tmp[4096];
+ struct timespec h = {0, 100 * 1000 * 1000};
if (strlen(send)) {
while ((timeout--) > 0) {
- usleep(100000);
+ nanosleep(&h, NULL);
ioctl(fd_modem,TIOCMGET,&out);
if (out & TIOCM_CTS) {
l=write(fd_modem,send,strlen(send));
@@ -97,7 +98,7 @@ int tty_modem(char* send, char *receive)
strncat(receive,tmp,in);
if (strchr(receive,'\r')) { break; }
}
- else { usleep(100000); }
+ else { nanosleep(&h, NULL); }
}
if (strlen(receive) > 0 && debug > 3) { fprintf(stderr, "%s\n", receive); }