Remove perror()

Makes getmyline() identical to the other simulators.
pull/1831/head
Daniele Forsi IU5HKX 2025-08-02 19:44:20 +02:00
rodzic ecece62828
commit 7fc222dc88
2 zmienionych plików z 2 dodań i 18 usunięć

Wyświetl plik

@ -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);

Wyświetl plik

@ -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);