From 960d59cbc490390d385ca7da470449f2e25cf97f Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Sun, 28 Sep 2014 12:09:19 +0200 Subject: [PATCH] Improved error output --- src/tty.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tty.c b/src/tty.c index dba9745..a343bdb 100644 --- a/src/tty.c +++ b/src/tty.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "gotty/tty.h" #include "gotty/print.h" #include "gotty/options.h" @@ -94,14 +95,14 @@ int connect_tty(void) fd = open(option.device, O_RDWR | O_NOCTTY ); if (fd <0) { - perror(option.device); + printf("\033[300DError: %s\n\033[300D", strerror(errno)); exit(EXIT_FAILURE); } /* Make sure device is of tty type */ if (!isatty(fd)) { - printf("Error: Not a tty device"); + printf("\033[300DError: Not a tty device\n\033[300D"); exit(EXIT_FAILURE); }