summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorIku <iku@yokattana.com>2017-02-09 08:02:11 +0100
committerIku <iku@yokattana.com>2017-02-09 09:09:31 +0100
commit895334d111060e805fbbe60b9020f6c32f3b90c5 (patch)
treed361f38c0da23960884e42191767364bce2d541d /src/main.c
parent474e05785ad4ecb3b40626093c51e9f69acf9000 (diff)
Address compiler warnings
(Compiling with GCC 4.8.4 on LXSS/Ubuntu) - unused results - incorrect size argument in fgetws One unused result warning, for dup(), has not been addressed because the author is not familiar with its use.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 70846db..21922e7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -166,7 +166,10 @@ int main (int argc, char ** argv) {
while (f != NULL && fgetws(stdin_buffer, BUFFERSIZE, f) != NULL) {
send_to_interp(stdin_buffer);
}
- freopen("/dev/tty", "rw", stdin);
+ if (!freopen("/dev/tty", "rw", stdin)) {
+ perror(NULL);
+ exit(-1);
+ }
flags = fcntl(fd, F_GETFL, 0);
flags &= ~O_NONBLOCK;
fcntl(fd, F_SETFL, flags);