[Top][All Lists]

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

[Bug-gnulib] Reorganization (was: Re: addition: pipe.h, pipe-in.c, pipe-

From: Simon Josefsson
Subject: [Bug-gnulib] Reorganization (was: Re: addition: pipe.h, pipe-in.c, pipe-out.c, pipe-bidi.c)
Date: Fri, 30 Jan 2004 00:58:17 +0100
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Paul Eggert <address@hidden> writes:

>> other modules (physmem, idcache, userspec, xgetdomainnname etc.) are
>> more rarely used than 'pipe'.
> Yes, there's probably other junk in gnulib too.  At some point someone
> should do some housecleaning.  Or reorganization.  Or something.
> Gnulib is becoming a bit unwieldy.

If someone does this, here's something I'd like: parametrization of
some modules so they can work more standalone.

My main example is the xalloc module, which depend on error,
unlocked-io, extensions, exitfail, inline, gettext and other stuff,
which brings in a considerable amount of code for something that
ideally should be a simple wrapper around malloc and friends.

Since I use the code in a library used by server processes, the
printed error message will rarely be seen even in the remote cases
when an out of memory condition do occur, so I don't consider it that
important, but even so I replaced:

  error (exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted));


  errno = ENOMEM;
  perror (PACKAGE);

which for my uses is about as flexible, and remove most of the
problematic dependencies.  It might even be better internationalized
because I believe the errno errors are widely translated, whereas the
xalloc_msg_memory_exhausted string must be translated manually in
every package that uses xalloc.

I might have made similar modifications to other modules as well.  I
rather dislike forking the code from gnulib, but I haven't come up
with a clean patch that I have any confidence in proposing.

[1] Perhaps using 'errno' as a rvalue isn't portable, so I'm not
seriously proposing the above, but it serves as an illustration.

reply via email to

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