diff --git a/src/socket.c b/src/socket.c index dcdf91f..b4a925e 100644 --- a/src/socket.c +++ b/src/socket.c @@ -173,21 +173,21 @@ void socket_configure(void) sockfd = socket(socket_family, SOCK_STREAM, 0); if (sockfd < 0) { - error_printf("Failed to create socket: %s", strerror(errno)); + error_printf("Failed to create socket (%s)", strerror(errno)); exit(EXIT_FAILURE); } /* Bind */ if (bind(sockfd, sockaddr_p, socklen) < 0) { - error_printf("Failed to bind to socket %s", strerror(errno)); + error_printf("Failed to bind to socket (%s)", strerror(errno)); exit(EXIT_FAILURE); } /* Listen */ if (listen(sockfd, MAX_SOCKET_CLIENTS) < 0) { - error_printf("Failed to listen on socket %s", strerror(errno)); + error_printf("Failed to listen on socket (%s)", strerror(errno)); exit(EXIT_FAILURE); } @@ -217,7 +217,7 @@ void socket_write(char input_char) { if (write(clientfds[i], &input_char, 1) <= 0) { - error_printf_silent("Failed to write to socket: %s", strerror(errno)); + error_printf_silent("Failed to write to socket (%s)", strerror(errno)); close(clientfds[i]); clientfds[i] = -1; } @@ -288,7 +288,7 @@ bool socket_handle_input(fd_set *rdfs, char *output_char) } if (status < 0) { - error_printf_silent("Failed to read from socket: %s", strerror(errno)); + error_printf_silent("Failed to read from socket (%s)", strerror(errno)); close(clientfds[i]); clientfds[i] = -1; continue; diff --git a/src/tty.c b/src/tty.c index aea1d58..cb48a08 100644 --- a/src/tty.c +++ b/src/tty.c @@ -135,7 +135,7 @@ static void toggle_line(const char *line_name, int mask) if (ioctl(fd, TIOCMGET, &state) < 0) { - warning_printf("Could not get line state: %s", strerror(errno)); + warning_printf("Could not get line state (%s)", strerror(errno)); } else { @@ -150,7 +150,7 @@ static void toggle_line(const char *line_name, int mask) tio_printf("set %s to HIGH", line_name); } if (ioctl(fd, TIOCMSET, &state) < 0) - warning_printf("Could not set line state: %s", strerror(errno)); + warning_printf("Could not set line state (%s)", strerror(errno)); } } @@ -196,7 +196,7 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c case KEY_SHIFT_L: if (ioctl(fd, TIOCMGET, &state) < 0) { - warning_printf("Could not get line state: %s", strerror(errno)); + warning_printf("Could not get line state (%s)", strerror(errno)); break; } tio_printf("Line states:");