[Bug gdb/12294] fopen("/dev/tty","r"); return NULL

silvia_si at hotmail dot com sourceware-bugzilla@sourceware.org
Wed Dec 8 15:44:00 GMT 2010


silvia_si at hotmail dot com changed:

           What    |Removed                     |Added
            Summary|fopen("/dev/tty","r");      |fopen("/dev/tty","r");
                   |                            |return NULL

--- Comment #1 from silvia_si at hotmail dot com 2010-12-07 21:23:33 UTC ---
Ubuntu 10.04 kernel 2.6.32-26-generic 
Netbeans 6.8 
GDB 7.1-ubuntu

Set Console type to Gnome terminal. 

FILE *input = NULL; 
input = fopen("/dev/tty","r"); 
returns NULL in debug mode (works fine in Run mode).

How to re-produce:

#include <termios.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/signal.h>
#include <sys/types.h>

  FILE *input = NULL; 
  input = fopen("/dev/tty","r"); 
In debug mode, fopen("/dev/tty","r"); return NULL.

This bug may be related to Bug 11403 - Failed to set controlling terminal,
as "/dev/tty" is the controlling terminal.

Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the Gdb-prs mailing list