Add some error message for some what-the-fuck-styled errors
This commit is contained in:
parent
a60e562fdb
commit
94f073c38d
1 changed files with 9 additions and 0 deletions
|
@ -54,16 +54,25 @@ int main(int argc, char **argv) {
|
||||||
struct termios t;
|
struct termios t;
|
||||||
|
|
||||||
if (ptsname_r(info.fd, name, sizeof(name)) < 0) {
|
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;
|
goto error_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tcgetattr(info.fd, &t) < 0) {
|
if (tcgetattr(info.fd, &t) < 0) {
|
||||||
|
fprintf(stderr, "%s: %s: %s: %s\n",
|
||||||
|
argv[0], argv[1], "tcgetattr()", strerror(errno));
|
||||||
|
|
||||||
goto error_open;
|
goto error_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
cfmakeraw(&t);
|
cfmakeraw(&t);
|
||||||
|
|
||||||
if (tcsetattr(info.fd, TCSANOW, &t) < 0) {
|
if (tcsetattr(info.fd, TCSANOW, &t) < 0) {
|
||||||
|
fprintf(stderr, "%s: %s: %s: %s\n",
|
||||||
|
argv[0], argv[1], "tcsetattr()", strerror(errno));
|
||||||
|
|
||||||
goto error_open;
|
goto error_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue