kopia lustrzana https://github.com/Hamlib/Hamlib
Replace "goto again" with "continue" (third case)
When the software on the other side of the pty closes the device, the simulator would close and reopen its side but it is unneeded because it can continue to call read() without doing anything special.pull/1831/head
rodzic
8887294cd8
commit
5b1517778e
|
@ -53,7 +53,6 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
unsigned char buf[BUFSIZE], buf2[256];
|
||||
|
||||
again:
|
||||
int fd = openPort(argv[1]);
|
||||
|
||||
while (1)
|
||||
|
@ -63,8 +62,7 @@ again:
|
|||
|
||||
if (bytes == 0)
|
||||
{
|
||||
close(fd);
|
||||
goto again;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bytes != 8)
|
||||
|
|
|
@ -21,7 +21,6 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
unsigned char buf[BUFSIZE];
|
||||
|
||||
again:
|
||||
int fd = openPort(argv[1]);
|
||||
|
||||
while (1)
|
||||
|
@ -30,8 +29,7 @@ again:
|
|||
|
||||
if (bytes == 0)
|
||||
{
|
||||
close(fd);
|
||||
goto again;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bytes != 5)
|
||||
|
|
|
@ -21,7 +21,6 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
unsigned char buf[BUFSIZE];
|
||||
|
||||
again:
|
||||
int fd = openPort(argv[1]);
|
||||
|
||||
while (1)
|
||||
|
@ -30,8 +29,7 @@ again:
|
|||
|
||||
if (bytes == 0)
|
||||
{
|
||||
close(fd);
|
||||
goto again;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bytes != 5)
|
||||
|
|
|
@ -23,7 +23,6 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
unsigned char buf[BUFSIZE];
|
||||
|
||||
again:
|
||||
int fd = openPort(argv[1]);
|
||||
|
||||
while (1)
|
||||
|
@ -32,8 +31,7 @@ again:
|
|||
|
||||
if (bytes == 0)
|
||||
{
|
||||
close(fd);
|
||||
goto again;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bytes != 5)
|
||||
|
|
|
@ -22,7 +22,6 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
unsigned char buf[BUFSIZE];
|
||||
|
||||
again:
|
||||
int fd = openPort(argv[1]);
|
||||
|
||||
while (1)
|
||||
|
@ -31,8 +30,7 @@ again:
|
|||
|
||||
if (bytes == 0)
|
||||
{
|
||||
close(fd);
|
||||
goto again;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bytes != 5)
|
||||
|
|
|
@ -24,7 +24,6 @@ int main(int argc, char *argv[])
|
|||
unsigned char buf[BUFSIZE];
|
||||
int freq, i, n;
|
||||
|
||||
again:
|
||||
int fd = openPort(argv[1]);
|
||||
|
||||
while (1)
|
||||
|
@ -33,8 +32,7 @@ again:
|
|||
|
||||
if (bytes == 0)
|
||||
{
|
||||
close(fd);
|
||||
goto again;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bytes != 5)
|
||||
|
|
|
@ -25,7 +25,6 @@ int main(int argc, char *argv[])
|
|||
unsigned char buf[BUFSIZE];
|
||||
int n;
|
||||
|
||||
again:
|
||||
int fd = openPort(argv[1]);
|
||||
|
||||
while (1)
|
||||
|
@ -34,8 +33,7 @@ again:
|
|||
|
||||
if (bytes == 0)
|
||||
{
|
||||
close(fd);
|
||||
goto again;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bytes != 5)
|
||||
|
|
|
@ -21,7 +21,6 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
unsigned char buf[BUFSIZE];
|
||||
|
||||
again:
|
||||
int fd = openPort(argv[1]);
|
||||
|
||||
while (1)
|
||||
|
@ -30,8 +29,7 @@ again:
|
|||
|
||||
if (bytes == 0)
|
||||
{
|
||||
close(fd);
|
||||
goto again;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bytes != 5)
|
||||
|
|
|
@ -50,7 +50,6 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
unsigned char buf[BUFSIZE];
|
||||
|
||||
again:
|
||||
int fd = openPort(argv[1]);
|
||||
|
||||
while (1)
|
||||
|
@ -59,8 +58,7 @@ again:
|
|||
|
||||
if (bytes == 0)
|
||||
{
|
||||
close(fd);
|
||||
goto again;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (buf[3])
|
||||
|
|
|
@ -40,7 +40,6 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
char buf[BUFSIZE], reply[256];
|
||||
|
||||
again:
|
||||
int fd = openPort(argv[1]);
|
||||
|
||||
while (1)
|
||||
|
@ -49,8 +48,7 @@ again:
|
|||
|
||||
if (bytes == 0)
|
||||
{
|
||||
close(fd);
|
||||
goto again;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strncmp(buf, "?V", 2) == 0)
|
||||
|
|
|
@ -56,7 +56,6 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
unsigned char buf[BUFSIZE];
|
||||
|
||||
again:
|
||||
int fd = openPort(argv[1]);
|
||||
|
||||
while (1)
|
||||
|
@ -65,8 +64,7 @@ again:
|
|||
|
||||
if (bytes == 0)
|
||||
{
|
||||
close(fd);
|
||||
goto again;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (buf[5])
|
||||
|
|
|
@ -21,7 +21,6 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
unsigned char buf[BUFSIZE];
|
||||
|
||||
again:
|
||||
int fd = openPort(argv[1]);
|
||||
|
||||
while (1)
|
||||
|
@ -30,8 +29,7 @@ again:
|
|||
|
||||
if (bytes == 0)
|
||||
{
|
||||
close(fd);
|
||||
goto again;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bytes != 5)
|
||||
|
|
Ładowanie…
Reference in New Issue