mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
manual: Fix termios.c example. (Bug 31078)
Remove the unused 'char *name;' from the example. Use write instead of putchar to write input as it is read. Example tested on x86_64 by compiling and running the example. Tested by building the manual pdf and reviewing the results. Reviewed-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
parent
a8830c9285
commit
3cbaacdfd2
1 changed files with 1 additions and 2 deletions
|
@ -34,7 +34,6 @@ void
|
||||||
set_input_mode (void)
|
set_input_mode (void)
|
||||||
{
|
{
|
||||||
struct termios tattr;
|
struct termios tattr;
|
||||||
char *name;
|
|
||||||
|
|
||||||
/* Make sure stdin is a terminal. */
|
/* Make sure stdin is a terminal. */
|
||||||
if (!isatty (STDIN_FILENO))
|
if (!isatty (STDIN_FILENO))
|
||||||
|
@ -70,7 +69,7 @@ main (void)
|
||||||
if (c == '\004') /* @kbd{C-d} */
|
if (c == '\004') /* @kbd{C-d} */
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
putchar (c);
|
write (STDOUT_FILENO, &c, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
Loading…
Add table
Reference in a new issue