From 94f073c38d3e1c518b55c5d40a96388eb57bdcec Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Mon, 29 Jun 2020 00:35:50 -0400 Subject: [PATCH] Add some error message for some what-the-fuck-styled errors --- src/testserver.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/testserver.c b/src/testserver.c index 6ab1d81..e772dca 100644 --- a/src/testserver.c +++ b/src/testserver.c @@ -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; }