Add some error message for some what-the-fuck-styled errors

This commit is contained in:
XANTRONIX Development 2020-06-29 00:35:50 -04:00 committed by XANTRONIX Industrial
parent a60e562fdb
commit 94f073c38d

View file

@ -54,16 +54,25 @@ int main(int argc, char **argv) {
struct termios t;
if (ptsname_r(info.fd, name, sizeof(name)) < 0) {
fprintf(stderr, "%s: %s: %s: %s\n",
argv[0], argv[1], "ptsname_r()", strerror(errno));
goto error_open;
}
if (tcgetattr(info.fd, &t) < 0) {
fprintf(stderr, "%s: %s: %s: %s\n",
argv[0], argv[1], "tcgetattr()", strerror(errno));
goto error_open;
}
cfmakeraw(&t);
if (tcsetattr(info.fd, TCSANOW, &t) < 0) {
fprintf(stderr, "%s: %s: %s: %s\n",
argv[0], argv[1], "tcsetattr()", strerror(errno));
goto error_open;
}