kopia lustrzana https://github.com/Hamlib/Hamlib
Remove perror()
Makes getmyline() identical to the other simulators.pull/1831/head
rodzic
ecece62828
commit
7fc222dc88
|
@ -217,22 +217,14 @@ getmyline(int fd, char *buf)
|
|||
char c;
|
||||
int i = 0;
|
||||
memset(buf, 0, BUFSIZE);
|
||||
int retval;
|
||||
|
||||
while ((retval = read(fd, &c, 1)) > 0)
|
||||
while (read(fd, &c, 1) > 0)
|
||||
{
|
||||
buf[i++] = c;
|
||||
|
||||
if (c == ';') { return strlen(buf); }
|
||||
}
|
||||
|
||||
if (retval != 0)
|
||||
{
|
||||
perror("read failed:");
|
||||
//close(fd);
|
||||
//fd = openPort("");
|
||||
}
|
||||
|
||||
if (strlen(buf) == 0) { hl_usleep(10 * 1000); }
|
||||
|
||||
return strlen(buf);
|
||||
|
|
|
@ -68,22 +68,14 @@ getmyline(int fd, char *buf)
|
|||
char c;
|
||||
int i = 0;
|
||||
memset(buf, 0, BUFSIZE);
|
||||
int retval;
|
||||
|
||||
while ((retval = read(fd, &c, 1)) > 0)
|
||||
while (read(fd, &c, 1) > 0)
|
||||
{
|
||||
buf[i++] = c;
|
||||
|
||||
if (c == ';') { return strlen(buf); }
|
||||
}
|
||||
|
||||
if (retval != 0)
|
||||
{
|
||||
perror("read failed:");
|
||||
//close(fd);
|
||||
//fd = openPort("");
|
||||
}
|
||||
|
||||
if (strlen(buf) == 0) { hl_usleep(10 * 1000); }
|
||||
|
||||
return strlen(buf);
|
||||
|
|
Ładowanie…
Reference in New Issue