[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] progname: also set global program_invocation_name, when poss
From: |
Jim Meyering |
Subject: |
Re: [PATCH] progname: also set global program_invocation_name, when possible |
Date: |
Tue, 25 Aug 2009 09:15:06 +0200 |
Bruno Haible wrote:
>> +2009-08-24 Jim Meyering <address@hidden>
>> +
>> + progname: also set global program_invocation_name, when possible
>> + Before this change, a libtool-enabled program that calls glibc's
>> + error function would report the program name as
>> + "/abs/dir/.libs/lt-program_name" rather than the desired program_name.
>> + * modules/progname (configure.ac): Check for a declaration of
>> + program_invocation_name.
>> + * lib/progname.c: Include <errno.h>.
>> + (set_program_name) [HAVE_DECL_PROGRAM_INVOCATION_NAME]:
>> + Set program_invocation_name.
>> +
>
> Thanks, I applied this for you, together with a couple of comments.
>
>> Before this change, I saw this:
>>
>> $ ./guestfish --help > /dev/full
>> /w/co/libguestfs/fish/.libs/lt-guestfish: write error: No space left on
>> device
>
> That must be because your package does not use the gnulib 'error' module.
> Which is perfectly fine if the package is only meant to run on Linux.
No. That package *does* use the error module.
However, per m4/error.m4, when building on a glibc-based system,
error.c is not compiled.
Your addition to this comment made it misleading:
/* On glibc systems, when the gnulib module 'error' is not used, the error()
function comes from libc and uses the variable program_invocation_name,
not program_name. So set this variable as well. */
I suggest removing the "when the gnulib module..." clause:
/* On glibc systems, the error() function comes from libc and
uses the variable program_invocation_name, not program_name.
So set this variable as well. */