bug-gnulib
[Top][All Lists]
Advanced

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

Re: error and program_name


From: Bruno Haible
Subject: Re: error and program_name
Date: Sun, 12 Dec 2010 12:49:16 +0100
User-agent: KMail/1.9.9

Eric Blake wrote, replying to Bruce Korb:
> > Then what is the solution?  It would not feel right to require programs
> > that are asking for "libposix" to also call a non-posix function just
> > because it is convenient for the error POSIX module.
> 
> error() is not POSIX.  Maybe the thing to do is figure out what in
> libposix is dragging in error(), and work on breaking that dependency.
> That way, a package using libposix then makes their own decision of
> whether to supplement things with error() and program_name.

Very good point. The dependency comes from

  openat     -->  openat-die  -->  error
  fdopendir

Can you work on breaking this dependency? I mean, for example,
instead of directly calling openat_save_fail() and
openat_restore_fail(), go through a variable that contains two
function pointers, and have openat() and fdopendir() return an error code
if these function pointers are NULL. Like we do with
  argp_program_version_hook
  error_print_progname
  obstack_alloc_failed_handler
See also
  c_stack_action
  install_sigpipe_die_handler

Bruno



reply via email to

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