From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2191) id 125113858D38; Mon, 20 Nov 2023 21:43:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 125113858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1700516610; bh=ejqNjbKywyQUBbpj2d2UgDGFlxE5lbkCj22M8WDo2m4=; h=From:To:Subject:Date:From; b=VPaNB5a5rIqphxlbcBE/gdr4O6gPvcu9kidbAYWhp42uoFf46OxPbnIIdlTOzHOWN JACBCGS/ZkN1YK/TlEnDBiidNHjTsMeTI+ZgL4KTEJJnqK+4LKgVD1gohtlKPpBD3l 6lO2bMbi9DSLs46oF4AuSEi8IRrXbt4q/nJKL3W0= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Carlos O'Donell To: glibc-cvs@sourceware.org Subject: [glibc] manual: Fix termios.c example. (Bug 31078) X-Act-Checkin: glibc X-Git-Author: Carlos O'Donell X-Git-Refname: refs/heads/master X-Git-Oldrev: a8830c928540011120ac742d632ed51d52af01df X-Git-Newrev: 3cbaacdfd2c11cb726011ef6464dce00c186a2bf Message-Id: <20231120214330.125113858D38@sourceware.org> Date: Mon, 20 Nov 2023 21:43:30 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3cbaacdfd2c11cb726011ef6464dce00c186a2bf commit 3cbaacdfd2c11cb726011ef6464dce00c186a2bf Author: Carlos O'Donell Date: Mon Nov 20 13:15:34 2023 -0500 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 Diff: --- manual/examples/termios.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manual/examples/termios.c b/manual/examples/termios.c index 751e57ad71..65bedad9cc 100644 --- a/manual/examples/termios.c +++ b/manual/examples/termios.c @@ -34,7 +34,6 @@ void set_input_mode (void) { struct termios tattr; - char *name; /* Make sure stdin is a terminal. */ if (!isatty (STDIN_FILENO)) @@ -70,7 +69,7 @@ main (void) if (c == '\004') /* @kbd{C-d} */ break; else - putchar (c); + write (STDOUT_FILENO, &c, 1); } return EXIT_SUCCESS;