[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#761300: libc6: Printf("%c",'x') does not follow stdio




Package: libc6
Version: 2.13-38+rpi2+deb7u3
Severity: normal

Dear Maintainer,

   * What led up to the situation?

Redirecting stdout in C code does not work for printf("%c",'x')
I ssh into the system.  I want to redirect all output to stdout to
the local terminal.  This works as expected for everything except
when printing a single character.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

  FILE *display_fp;
  if ((display_fp = fopen("/dev/tty1","r+")) == NULL) {
 perror("Open /dev/tty1");
 return -1;
  }
  stdout = display_fp;

Then,

printf("%s","asdfasdf"); /* output to /dev/tty1 */
printf("%c",'x'); /* output to original terminal */

   * What was the outcome of this action?

All the output except for the "%c" case went to /dev/tty1.  The
output in the "%c" case went to the ssh terminal

   * What outcome did you expect instead?

I expected all the output to go to /dev/tty1



-- System Information:
Debian Release: 7.6
Architecture: armhf (armv6l)

Kernel: Linux 3.12.22+ (PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: L
C_ALL set to C)
Shell: /bin/sh linked to /bin/dash

Versions of packages libc6 depends on:
ii  libc-bin  2.13-38+rpi2+deb7u3
ii  libgcc1   1:4.7.2-5+rpi1

libc6 recommends no packages.

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.49
pn  glibc-doc              <none>
ii  locales                2.13-38+rpi2+deb7u3

-- debconf information:
  glibc/upgrade: true
  glibc/restart-services:
* libraries/restart-without-asking: true
  glibc/disable-screensaver:
  glibc/restart-failed:


Reply to: