bug-ncurses
[Top][All Lists]
Advanced

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

Re: dangling errno in _nc_access (ncurses-4.3/ncurses/tinfo/access.c)


From: Thomas Dickey
Subject: Re: dangling errno in _nc_access (ncurses-4.3/ncurses/tinfo/access.c)
Date: Fri, 14 Feb 2003 18:20:45 -0500
User-agent: Mutt/1.3.27i

On Fri, Feb 14, 2003 at 04:14:58AM +0200, Toomas Rosin wrote:
> Ladies and gentlemen,
> 
> My program uses the Readline library, which uses ncurses.  When
> debugging it, I was very surprised to find that the first (and
> successful) call to readline() set errno to ENOENT.  At the point
> where errno changed, the stack trace looked like this:
...
> I.e. the ENOENT was a result of not finding a terminfo entry for $TERM
> under $HOME/.terminfo.  As the entry was happily found in the system
> terminfo database, and as nothing in ncurses seems to use the errno
> value that was set in _nc_access, should _nc_access (or setupterm, or
> tgetent) not reset errno to zero?

not exactly - this manpage corresponds well enough to my recollection:

ERRNO(3)                Library functions                ERRNO(3)


NAME
       errno - number of last error

SYNOPSIS
       #include <errno.h>

       extern int errno;

DESCRIPTION
       The integer errno is set by system calls (and some library
       functions) to indicate what went wrong.  Its value is sig-
       nificant  only  when  the  call returned an error (usually
       -1), and a library function that does succeed  is  allowed
       to change errno.

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net




reply via email to

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