This is to fix the issue #104. The timestamp will always be
printed at the beginning of line:
[10:25:56] Switched to hexadecimal mode
0d 0a 0d [10:25:57] 41 43 52 4e 3a 5c 3e 0d 0a 0d [10:25:58] 41
is changed to:
[12:34:56] 45 72 72 6f 72 3a 20 49 6e 76 61 6c 69 64 20
[12:34:56] 41 43 52 4e 3a 5c 3e
[12:34:56] 41 43 52 4e 3a 5c 3e
[12:34:57] 41 43 52 4e 3a 5c 3e 6c 73
Out of tree builds are currently broken because $(top_srcdir)src/include
is not in the search path. In tree builds are working because autconf add
$(top_builddir)/src/include to the search path for the generated config.h.
As $(top_builddir) and $(top_srcdir) are identical during in tree builds
the search path still end up beeing somehow correct.
To fix this add -I$(srcdir)/include to the CPPFLAGS in Makefile.am.
Include ioctls.h and termbits.h from asm-generic instead of asm to avoid
the following build failure:
In file included from setspeed2.c:24:0:
/home/naourr/work/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/asm/termbits.h:17:8: error: redefinition of 'struct termio'
struct termio {
^~~~~~
In file included from /home/naourr/work/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/sys/ioctl.h:29:0,
from setspeed2.c:22:
/home/naourr/work/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/bits/ioctl-types.h:36:8: note: originally defined here
struct termio
^~~~~~
Fixes:
- http://autobuild.buildroot.org/results/1a7418b9cd11374a250f7509d5bddcc864375e1c
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
In order for local echo to work properly, we have to either call
fflush(stdout) after every character or just disable line buffering.
This change calls fflush() after putchar().
Closes#92
In order for local echo to work properly, we have to either call
fflush(stdout) after every character or just disable line buffering.
This change uses setbuf(stdout, NULL) to do the latter.
Closes#92
This mostly is intended to have local echo output exactly what is sent
to the remote endpoint.
A nice side-effect is, that it also fixes tty-implementations, that can't
deal with the OCRNL flag on tio.c_oflag.
Logfiles are important to see what happend, in particular if something
unexpected happened; so we want to make sure that the logfile is flushed
to disk.
Before this change, the logfile was typically written at the end in
a large chunk as the default (large) buffering applied. Now, characters are
written out ASAP, so it is possible to get a live-view with a
tail -f <logfile>
The following new mapping flags are added:
INLCRNL: Map NL to CR-NL on input.
ODELBS: Map DEL to BS on output.
Flags requested and tested by Jan Ciger (janoc).
Support for non-standard baudrate settings will be automatically enabled
if the termios2 interface is detected available. However, to play it
safe, the old and widely supported termios interface will still be used
when setting standard baudrates.