This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


http://sourceware.org/bugzilla/show_bug.cgi?id=12294

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>

main{
  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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]