Skip to content

Commit

Permalink
ubx_log: turn off echoing
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Klotzbuecher <mk@mkio.de>
  • Loading branch information
kmarkus committed Jan 21, 2020
1 parent c791732 commit e5691a8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tools/ubx_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <sys/inotify.h>

#include "ubx.h"
Expand Down Expand Up @@ -350,6 +351,7 @@ int main(int argc, char **argv)
{
int opt, color = 1, show_old = 1, ret = EOUTOFMEM;
struct ubx_log_info *inf;
struct termios tp;
char c;

while ((opt = getopt(argc, argv, "ONh")) != -1) {
Expand All @@ -376,7 +378,17 @@ int main(int argc, char **argv)
inf->lcinf = NULL;
inf->uininf = NULL;

fcntl (0, F_SETFL, O_NONBLOCK);
/* make stdin nonblocking */
fcntl (STDIN_FILENO, F_SETFL, O_NONBLOCK);

/* turn echo off */
if (tcgetattr(STDIN_FILENO, &tp) == -1)
fprintf(stderr, "tcgetattr: %m");

tp.c_lflag &= ~ECHO;

if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &tp) == -1)
fprintf(stderr, "tcsetattr: %m");

ret = lc_init(inf);
if (ret != 0)
Expand Down

0 comments on commit e5691a8

Please sign in to comment.