mirror of
https://github.com/openwrt/telephony.git
synced 2026-01-07 23:10:16 +04:00
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>
25 lines
704 B
Diff
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); }
|
|
|