[Top][All Lists]

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

newterm() returning NULL on serial console

From: Katarina Machalkova
Subject: newterm() returning NULL on serial console
Date: Tue, 7 Nov 2006 03:54:52 -0500
User-agent: KMail/1.9.5

Hi there!

I have the following code snippet:

char * mytty = ttyname( 0 );
    if ( mytty ) {
      FILE * fdi = fopen( mytty, "r" );
      if (!fdi) {
         UIERR << "fdi: (" << errno << ") " << strerror(errno) << endl;
      FILE * fdo = fopen( mytty, "w" );
      if (!fdo) {
         UIERR << "fdo: (" << errno << ") " << strerror(errno) << endl;
      if ( fdi && fdo ) {
        theTerm = newterm( 0, fdo, fdi );
        if ( theTerm == NULL )
          throw NCursesError( "newterm() failed" );
The problem is, that once 'console=ttyS0' parameter is passed to the kernel at 
boot (this is SUSE Linux Enterprise Server 10), newterm() function in this 
code keeps returning NULL pointer. 

What happens here is that:
* ttyname() correctly returns '/dev/console' string
* fopen() call succesfully opens /dev/console for reading and for writing 
(i.e. returns non-NULL pointers)
* yet newterm() returns NULL once serial console is used, no matter what TERM 
environment variable is used. Without serial console, all works fine

Any clue what might be going wrong in newterm() function ? Or what else should 
I check and who might be the possible culprit ? 

Unfortunately, the machine on which the error can be reproduced is somewhere 
at the customer's site and I have neither physical nor network access to 
it  :-( and I cannot easily debug it
Yet I would be grateful for any ideas or suggestions ...

   \\\\\              Katarina Machalkova    
  \\\\\\\__o          YaST developer
__\\\\\\\'/_          & hedgehog painter

Attachment: pgp3eY5wNFZd9.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]